-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'qa' into self-hosting-setup
- Loading branch information
Showing
34 changed files
with
725 additions
and
101 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
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> | ||
); | ||
}; |
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
Oops, something went wrong.