Skip to content

Commit

Permalink
chore: Prettify
Browse files Browse the repository at this point in the history
  • Loading branch information
VVoruganti committed Jan 14, 2025
1 parent ac9f0a8 commit 33ad2bc
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 18 deletions.
13 changes: 8 additions & 5 deletions www/app/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,9 @@ What's on your mind? Let's dive in. 🌱`,
try {
// Process thought and summary in parallel if this is the first message
const isFirstChat = messages?.length === 0;
const isUntitledConversation = conversations?.find(c => c.conversationId === conversationId)?.name === 'Untitled';
const isUntitledConversation =
conversations?.find((c) => c.conversationId === conversationId)
?.name === 'Untitled';
const shouldGenerateSummary = isFirstChat || isUntitledConversation;
const [thoughtText] = await Promise.all([
processThought(messageToSend, conversationId!),
Expand Down Expand Up @@ -564,10 +566,11 @@ What's on your mind? Let's dive in. 🌱`,
placeholder={
canUseApp ? 'Type a message...' : 'Subscribe to send messages'
}
className={`flex-1 px-3 py-1 lg:px-5 lg:py-3 bg-accent text-gray-400 rounded-2xl border-2 resize-none outline-none focus:outline-none ${canSend && canUseApp
? 'border-green-200 focus:border-green-200'
: 'border-red-200 focus:border-red-200 opacity-50'
}`}
className={`flex-1 px-3 py-1 lg:px-5 lg:py-3 bg-accent text-gray-400 rounded-2xl border-2 resize-none outline-none focus:outline-none ${
canSend && canUseApp
? 'border-green-200 focus:border-green-200'
: 'border-red-200 focus:border-red-200 opacity-50'
}`}
rows={1}
disabled={!canUseApp}
onKeyDown={(e) => {
Expand Down
22 changes: 13 additions & 9 deletions www/app/settings/SettingsLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,22 @@ export default function SettingsLayout({
subscription,
products,
}: SettingsProps) {
const navItems = useMemo(() => [
{ id: 'account', label: 'Account' },
{ id: 'security', label: 'Security' },
{ id: 'subscription', label: 'Subscription' },
{ id: 'support', label: 'Support' },
], []);
const navItems = useMemo(
() => [
{ id: 'account', label: 'Account' },
{ id: 'security', label: 'Security' },
{ id: 'subscription', label: 'Subscription' },
{ id: 'support', label: 'Support' },
],
[]
);

const [activeTab, setActiveTab] = useState('account'); // Default to 'account' initially

useEffect(() => {
const handleHashChange = () => {
const hash = window.location.hash.replace('#', '');
if (navItems.some(item => item.id === hash)) {
if (navItems.some((item) => item.id === hash)) {
setActiveTab(hash);
}
};
Expand All @@ -56,10 +59,11 @@ export default function SettingsLayout({
setActiveTab(item.id);
window.location.hash = item.id;
}}
className={`w-full text-left p-2 rounded transition-colors ${activeTab === item.id
className={`w-full text-left p-2 rounded transition-colors ${
activeTab === item.id
? 'bg-accent text-foreground'
: 'hover:bg-gray-200 hover:text-gray-900 dark:hover:bg-neon-green/20 dark:hover:text-neon-green'
}`}
}`}
>
{item.label}
</button>
Expand Down
6 changes: 5 additions & 1 deletion www/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ export function Header() {
height={32}
className="rounded-full"
/>
<span className={`text-foreground text-xl font-departure ${departureMono.className}`}>BLOOM</span>
<span
className={`text-foreground text-xl font-departure ${departureMono.className}`}
>
BLOOM
</span>
</Link>
<div className="flex justify-between items-center gap-4">
<DarkModeSwitch
Expand Down
2 changes: 0 additions & 2 deletions www/components/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import { type Conversation, type Message } from '@/utils/types';
import { clearSWRCache } from '@/utils/swrCache';
import { departureMono } from '@/utils/fonts';



export default function Sidebar({
conversations,
mutateConversations,
Expand Down
2 changes: 1 addition & 1 deletion www/utils/fonts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import localFont from 'next/font/local';

export const departureMono = localFont({
src: '../fonts/DepartureMono-Regular.woff2',
});
});

0 comments on commit 33ad2bc

Please sign in to comment.