forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2804 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes up to ad95c98
- Loading branch information
Showing
133 changed files
with
1,410 additions
and
817 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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 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 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 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 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
31 changes: 0 additions & 31 deletions
31
app/javascript/flavours/glitch/features/notifications/components/checkbox_with_label.jsx
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
app/javascript/flavours/glitch/features/notifications/components/checkbox_with_label.tsx
This file contains 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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import type { PropsWithChildren } from 'react'; | ||
import { useCallback } from 'react'; | ||
|
||
import Toggle from 'react-toggle'; | ||
|
||
interface Props { | ||
checked: boolean; | ||
disabled?: boolean; | ||
onChange: (checked: boolean) => void; | ||
} | ||
|
||
export const CheckboxWithLabel: React.FC<PropsWithChildren<Props>> = ({ | ||
checked, | ||
disabled, | ||
children, | ||
onChange, | ||
}) => { | ||
const handleChange = useCallback( | ||
({ target }: React.ChangeEvent<HTMLInputElement>) => { | ||
onChange(target.checked); | ||
}, | ||
[onChange], | ||
); | ||
|
||
return ( | ||
<label className='app-form__toggle'> | ||
<div className='app-form__toggle__label'>{children}</div> | ||
|
||
<div className='app-form__toggle__toggle'> | ||
<div> | ||
<Toggle | ||
checked={checked} | ||
onChange={handleChange} | ||
disabled={disabled} | ||
/> | ||
</div> | ||
</div> | ||
</label> | ||
); | ||
}; |
Oops, something went wrong.