Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small tweaks for icons and language #386

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/web/src/components/apps/diff-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function DiffModalHeader({
return (
<div className="h-12 px-4 flex items-center justify-between border-b border-border">
<div>
<DialogTitle className="font-semibold">{`${numFiles} files changed`}</DialogTitle>
<DialogTitle className="font-semibold">{`${numFiles} ${numFiles === 1 ? 'file' : 'files'} changed`}</DialogTitle>
</div>
<div className="flex items-center space-x-3">
<Button variant="secondary" className="flex items-center space-x-1.5" onClick={onUndoAll}>
Expand Down
19 changes: 14 additions & 5 deletions packages/web/src/components/apps/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
KeyboardIcon,
MoonIcon,
SettingsIcon,
SunIcon,
} from 'lucide-react';
import { Button } from '@srcbook/components/src/components/ui/button';
import {
Expand Down Expand Up @@ -37,7 +38,7 @@ function getTitleForPanel(panel: PanelType | null): string | null {
}

export default function Sidebar() {
const { toggleTheme } = useTheme();
const { theme, toggleTheme } = useTheme();
const { openedFile } = useFiles();

const [showShortcuts, setShowShortcuts] = useState(false);
Expand Down Expand Up @@ -80,14 +81,22 @@ export default function Sidebar() {
</NavItemWithTooltip>
</div>
<div className="flex flex-col items-center w-full gap-2">
{process.env.NODE_ENV !== 'production' && (
<NavItemWithTooltip tooltipContent="DEV ONLY - Switch theme" onClick={toggleTheme}>
<NavItemWithTooltip
tooltipContent={theme === 'light' ? 'Dark mode' : 'Light mode'}
onClick={toggleTheme}
>
{theme === 'light' ? (
<MoonIcon
size={18}
className="text-tertiary-foreground hover:text-secondary-foreground transition-colors"
/>
</NavItemWithTooltip>
)}
) : (
<SunIcon
size={18}
className="text-tertiary-foreground hover:text-secondary-foreground transition-colors"
/>
)}
</NavItemWithTooltip>
<NavItemWithTooltip
tooltipContent="Keyboard shortcuts"
onClick={() => setShowShortcuts(true)}
Expand Down