-
Notifications
You must be signed in to change notification settings - Fork 55
Remade the activity tracker #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a4d6030
Remade the activity tracker
breadddevv bf142bd
Potential fix for pull request finding 'CodeQL / Use of externally-co…
breadddevv fae6cdc
Potential fix for pull request finding 'CodeQL / Use of externally-co…
breadddevv d92a2a4
Update pages/api/activity/config.ts
breadddevv 0aa01be
Update Orbit-activity.rbxmx
breadddevv 82b6ed0
Update Orbit-activity.rbxmx
breadddevv 8ba07d2
Update components/switch.tsx
breadddevv fbffb23
sum fixes
breadddevv 992a4b7
bread this is luau not js
breadddevv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,47 @@ | ||
| import React, { FC, ReactNode } from "react"; | ||
| import { twMerge } from "tailwind-merge"; | ||
| import { workspacestate } from "@/state"; | ||
| import { useRecoilState } from "recoil"; | ||
| import { Switch } from "@headlessui/react"; | ||
| type Props = { | ||
| onChange?: () => void; | ||
| label: string; | ||
| classoverride?: string; | ||
| disabled?: boolean | false; | ||
| checked?: boolean | false; | ||
| import { FC } from "react"; | ||
| import clsx from "clsx"; | ||
|
|
||
| type Props = { | ||
| onChange?: () => void; | ||
| label: string; | ||
| classoverride?: string; | ||
| disabled?: boolean; | ||
| checked?: boolean; | ||
| }; | ||
|
|
||
| const SwitchComponenet: FC<Props> = ({ disabled, onChange, label, checked }: Props) => { | ||
| return ( | ||
| <div className="flex flex-row"> | ||
| <Switch | ||
| checked={checked} | ||
| className={`${checked ? 'bg-primary' : 'bg-zinc-200' | ||
| } relative inline-flex h-6 w-11 items-center rounded-full shadow-inner mb-2`} | ||
| onChange={onChange} | ||
| > | ||
| <span | ||
| className={`${checked ? 'translate-x-6' : 'translate-x-1' | ||
| } inline-block h-4 w-4 transform rounded-full bg-white transition shadow`} | ||
| /> | ||
| </Switch> | ||
| <p className="ml-2 dark:text-white">{label}</p> | ||
| </div> | ||
|
|
||
| ); | ||
| const SwitchComponenet: FC<Props> = ({ | ||
| disabled, | ||
| onChange, | ||
| label, | ||
| checked, | ||
| classoverride, | ||
| }: Props) => { | ||
| return ( | ||
| <div className={clsx("flex items-center", classoverride)}> | ||
| <button | ||
| type="button" | ||
| role="switch" | ||
| aria-checked={checked} | ||
| disabled={disabled} | ||
| onClick={onChange} | ||
| className={clsx( | ||
| "relative inline-flex h-6 w-11 shrink-0 rounded-full transition-colors duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2", | ||
| disabled | ||
| ? "cursor-not-allowed bg-zinc-200 dark:bg-zinc-700" | ||
| : "cursor-pointer", | ||
| !disabled && (checked ? "bg-primary" : "bg-zinc-200 dark:bg-zinc-700") | ||
| )} | ||
|
breadddevv marked this conversation as resolved.
|
||
| > | ||
| <span | ||
| className="inline-block h-5 w-5 rounded-full bg-white shadow-sm transition-transform duration-200 mt-0.5" | ||
| style={{ transform: checked ? "translateX(22px)" : "translateX(2px)" }} | ||
| /> | ||
| </button> | ||
| {label ? ( | ||
| <p className="ml-2 text-sm text-zinc-700 dark:text-white">{label}</p> | ||
| ) : null} | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default SwitchComponenet; | ||
| export default SwitchComponenet; | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.