-
Notifications
You must be signed in to change notification settings - Fork 828
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(flat-pages): update preferences modal styles (#1933)
* refactor(flat-pages): update preferences modal styles - move general settings label to first row's center - update theme picker styles * reset index on close preferences modal * update network status popover styles * fix: update avatars styles on edge case
- Loading branch information
Showing
10 changed files
with
153 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,7 @@ | |
} | ||
|
||
.video-avatar-absent-desc { | ||
padding-left: 4px; | ||
white-space: nowrap; | ||
} | ||
|
||
|
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
67 changes: 67 additions & 0 deletions
67
packages/flat-pages/src/components/PreferencesButton/GeneralSettings/AppearanceSettings.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,67 @@ | ||
import type { PreferencesButtonProps } from "../index"; | ||
|
||
import React, { useCallback, useContext } from "react"; | ||
import { observer } from "mobx-react-lite"; | ||
import { Radio } from "antd"; | ||
|
||
import { useTranslate } from "@netless/flat-i18n"; | ||
import { PreferencesStoreContext } from "../../StoreProvider"; | ||
|
||
export interface AppearanceSettingsProps extends PreferencesButtonProps {} | ||
|
||
export const AppearanceSettings = observer<AppearanceSettingsProps>(function AppearanceSettings() { | ||
const t = useTranslate(); | ||
const preferences = useContext(PreferencesStoreContext); | ||
|
||
const changeAppearance = useCallback( | ||
(ev: any) => preferences.updatePrefersColorScheme(ev.target.value), | ||
[preferences], | ||
); | ||
|
||
return ( | ||
<> | ||
<label className="preferences-modal-section-grid-label first-row" htmlFor="theme"> | ||
{t("theme")} | ||
</label> | ||
<Radio.Group | ||
className="preferences-modal-section-grid-content" | ||
id="theme" | ||
name="theme" | ||
value={preferences.prefersColorScheme} | ||
onChange={changeAppearance} | ||
> | ||
<Radio className="preferences-modal-section-radio" value="light"> | ||
<span className="preferences-modal-section-theme light"> | ||
<span className="preferences-modal-section-theme-front"></span> | ||
<span className="preferences-modal-section-theme-front"></span> | ||
<span className="preferences-modal-section-theme-front"></span> | ||
</span> | ||
<span>{t("app-appearance-light")}</span> | ||
</Radio> | ||
<Radio className="preferences-modal-section-radio" value="dark"> | ||
<span className="preferences-modal-section-theme dark"> | ||
<span className="preferences-modal-section-theme-front"></span> | ||
<span className="preferences-modal-section-theme-front"></span> | ||
<span className="preferences-modal-section-theme-front"></span> | ||
</span> | ||
<span>{t("app-appearance-dark")}</span> | ||
</Radio> | ||
<Radio className="preferences-modal-section-radio" value="auto"> | ||
<span className="preferences-modal-section-theme auto"> | ||
<span className="preferences-modal-section-theme light"> | ||
<span className="preferences-modal-section-theme-front"></span> | ||
<span className="preferences-modal-section-theme-front"></span> | ||
<span className="preferences-modal-section-theme-front"></span> | ||
</span> | ||
<span className="preferences-modal-section-theme dark"> | ||
<span className="preferences-modal-section-theme-front"></span> | ||
<span className="preferences-modal-section-theme-front"></span> | ||
<span className="preferences-modal-section-theme-front"></span> | ||
</span> | ||
</span> | ||
<span>{t("app-appearance-auto")}</span> | ||
</Radio> | ||
</Radio.Group> | ||
</> | ||
); | ||
}); |
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