-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
212 additions
and
140 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./DeleteAccountSetting"; |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./EditBirthplaceSetting"; |
28 changes: 28 additions & 0 deletions
28
src/components/settings/EditMinorSetting/EditMinorSetting.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,28 @@ | ||
import { Switch } from "@/components/common"; | ||
import { SettingsItem } from "@/components/settings"; | ||
import { api } from "@convex/_generated/api"; | ||
import type { Doc } from "@convex/_generated/dataModel"; | ||
import { useMutation } from "convex/react"; | ||
|
||
type EditMinorSettingProps = { | ||
user: Doc<"users">; | ||
}; | ||
|
||
export const EditMinorSetting = ({ user }: EditMinorSettingProps) => { | ||
const updateIsMinor = useMutation(api.users.setCurrentUserIsMinor); | ||
|
||
return ( | ||
<SettingsItem | ||
label="Under 18" | ||
description="Are you under 18 years old or applying on behalf of someone who is?" | ||
> | ||
<Switch | ||
name="isMinor" | ||
isSelected={user.isMinor ?? false} | ||
onChange={() => updateIsMinor({ isMinor: !user.isMinor })} | ||
> | ||
<span className="sr-only">Is minor</span> | ||
</Switch> | ||
</SettingsItem> | ||
); | ||
}; |
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 @@ | ||
export * from "./EditMinorSetting"; |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./EditNameSetting"; |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./EditResidenceSetting"; |
25 changes: 25 additions & 0 deletions
25
src/components/settings/EditThemeSetting/EditThemeSetting.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,25 @@ | ||
import { ToggleButton, ToggleButtonGroup } from "@/components/common"; | ||
import { useTheme } from "@/utils/useTheme"; | ||
import { THEMES } from "@convex/constants"; | ||
import { SettingsItem } from "../SettingsItem"; | ||
|
||
export const EditThemeSetting = () => { | ||
const { themeSelection, setTheme } = useTheme(); | ||
|
||
return ( | ||
<SettingsItem label="Theme" description="Adjust your display."> | ||
<ToggleButtonGroup | ||
selectionMode="single" | ||
disallowEmptySelection | ||
selectedKeys={themeSelection} | ||
onSelectionChange={setTheme} | ||
> | ||
{Object.entries(THEMES).map(([theme, details]) => ( | ||
<ToggleButton key={theme} id={theme}> | ||
{details.label} | ||
</ToggleButton> | ||
))} | ||
</ToggleButtonGroup> | ||
</SettingsItem> | ||
); | ||
}; |
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 @@ | ||
export * from "./EditThemeSetting"; |
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
export * from "./DeleteAccountDialog"; | ||
export * from "./EditBirthplaceDialog"; | ||
export * from "./EditNameDialog"; | ||
export * from "./EditResidenceDialog"; | ||
export * from "./DeleteAccountSetting"; | ||
export * from "./EditBirthplaceSetting"; | ||
export * from "./EditNameSetting"; | ||
export * from "./EditMinorSetting"; | ||
export * from "./EditResidenceSetting"; | ||
export * from "./EditThemeSetting"; | ||
export * from "./SettingsGroup"; | ||
export * from "./SettingsItem"; |
Oops, something went wrong.