-
Notifications
You must be signed in to change notification settings - Fork 163
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 #1974 from quadratichq/qa
QA: Oct 15th
- Loading branch information
Showing
42 changed files
with
1,482 additions
and
412 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
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
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
61 changes: 61 additions & 0 deletions
61
quadratic-client/src/app/ui/components/ThemePickerMenu.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,61 @@ | ||
import { focusGrid } from '@/app/helpers/focusGrid'; | ||
import { SidebarToggle, SidebarTooltip } from '@/app/ui/QuadraticSidebar'; | ||
import { ThemeIcon } from '@/shared/components/Icons'; | ||
import { ThemeAccentColors } from '@/shared/components/ThemeAccentColors'; | ||
import { ThemeAppearanceModes } from '@/shared/components/ThemeAppearanceModes'; | ||
import { useFeatureFlag } from '@/shared/hooks/useFeatureFlag'; | ||
import { Popover, PopoverContent, PopoverTrigger } from '@/shared/shadcn/ui/popover'; | ||
import { useState } from 'react'; | ||
|
||
export const ThemePickerMenu = () => { | ||
const [featureFlagThemeAccentColor] = useFeatureFlag('themeAccentColor'); | ||
const [featureFlagThemeAppearanceMode] = useFeatureFlag('themeAppearanceMode'); | ||
const [showThemeMenu, setShowThemeMenu] = useState(false); | ||
|
||
if (!(featureFlagThemeAccentColor || featureFlagThemeAppearanceMode)) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<Popover open={showThemeMenu} onOpenChange={setShowThemeMenu}> | ||
<SidebarTooltip label="Theme"> | ||
<PopoverTrigger asChild> | ||
<SidebarToggle pressed={showThemeMenu} onPressedChange={() => setShowThemeMenu(!showThemeMenu)}> | ||
<ThemeIcon /> | ||
</SidebarToggle> | ||
</PopoverTrigger> | ||
</SidebarTooltip> | ||
|
||
<PopoverContent | ||
side="right" | ||
align="end" | ||
className="w-80" | ||
onCloseAutoFocus={(e) => { | ||
e.preventDefault(); | ||
focusGrid(); | ||
}} | ||
> | ||
<h2 className="text-md font-semibold">Theme customization</h2> | ||
<p className="mb-4 text-xs text-muted-foreground">Pick a style that fits you</p> | ||
|
||
{featureFlagThemeAccentColor && ( | ||
<> | ||
<h3 className="mb-1 text-xs font-semibold">Accent color</h3> | ||
<div className="grid grid-cols-3 gap-2"> | ||
<ThemeAccentColors /> | ||
</div> | ||
</> | ||
)} | ||
{featureFlagThemeAppearanceMode && ( | ||
<> | ||
<h3 className="mb-1 mt-4 text-xs font-semibold">Appearance</h3> | ||
|
||
<div className="grid grid-cols-3 gap-2"> | ||
<ThemeAppearanceModes /> | ||
</div> | ||
</> | ||
)} | ||
</PopoverContent> | ||
</Popover> | ||
); | ||
}; |
Oops, something went wrong.