Skip to content

Commit

Permalink
Run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
VVoruganti committed Oct 18, 2024
1 parent 91b40e2 commit d78643a
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 92 deletions.
72 changes: 37 additions & 35 deletions www/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ import useSWR from 'swr';

import dynamic from 'next/dynamic';

import banner from "@/public/bloom2x1.svg";
import darkBanner from "@/public/bloom2x1dark.svg";
import { DarkModeSwitch } from "react-toggle-dark-mode";
import { FaLightbulb, FaPaperPlane, FaBars } from "react-icons/fa";
import Swal from "sweetalert2";
import banner from '@/public/bloom2x1.svg';
import darkBanner from '@/public/bloom2x1dark.svg';
import { DarkModeSwitch } from 'react-toggle-dark-mode';
import { FaLightbulb, FaPaperPlane, FaBars } from 'react-icons/fa';
import Swal from 'sweetalert2';

import { useRef, useEffect, useState, ElementRef } from 'react';
import { redirect } from 'next/navigation';
import { usePostHog } from 'posthog-js/react';

import { getSubscription } from '@/utils/supabase/queries';

import { API } from "@/utils/api";
import { createClient } from "@/utils/supabase/client";
import { Reaction } from "@/components/messagebox";
import { API } from '@/utils/api';
import { createClient } from '@/utils/supabase/client';
import { Reaction } from '@/components/messagebox';

const Thoughts = dynamic(() => import("@/components/thoughts"), {
const Thoughts = dynamic(() => import('@/components/thoughts'), {
ssr: false,
});
const MessageBox = dynamic(() => import("@/components/messagebox"), {
const MessageBox = dynamic(() => import('@/components/messagebox'), {
ssr: false,
});
const Sidebar = dynamic(() => import("@/components/sidebar"), {
const Sidebar = dynamic(() => import('@/components/sidebar'), {
ssr: false,
});

Expand Down Expand Up @@ -164,7 +164,7 @@ export default function Home() {
});
}, true);
} catch (error) {
console.error("Failed to update reaction:", error);
console.error('Failed to update reaction:', error);
}
};

Expand Down Expand Up @@ -272,8 +272,9 @@ export default function Home() {

return (
<main
className={`flex h-[100dvh] w-screen flex-col pb-[env(keyboard-inset-height)] text-sm lg:text-base overflow-hidden relative ${isDarkMode ? 'dark' : ''
}`}
className={`flex h-[100dvh] w-screen flex-col pb-[env(keyboard-inset-height)] text-sm lg:text-base overflow-hidden relative ${
isDarkMode ? 'dark' : ''
}`}
>
<Sidebar
conversations={conversations || []}
Expand Down Expand Up @@ -339,23 +340,23 @@ export default function Home() {
onReactionAdded={handleReactionAdded}
/>
)) || (
<MessageBox
isUser={false}
message={{
text: "",
id: "",
isUser: false,
metadata: { reaction: null },
}}
loading={true}
setThought={setThought}
setIsThoughtsOpen={setIsThoughtsOpen}
onReactionAdded={handleReactionAdded}
userId={userId}
URL={URL}
conversationId={conversationId}
/>
)}
<MessageBox
isUser={false}
message={{
text: '',
id: '',
isUser: false,
metadata: { reaction: null },
}}
loading={true}
setThought={setThought}
setIsThoughtsOpen={setIsThoughtsOpen}
onReactionAdded={handleReactionAdded}
userId={userId}
URL={URL}
conversationId={conversationId}
/>
)}
</section>
<form
id="send"
Expand All @@ -374,10 +375,11 @@ export default function Home() {
placeholder={
isSubscribed ? 'Type a message...' : 'Subscribe to send messages'
}
className={`flex-1 px-3 py-1 lg:px-5 lg:py-3 bg-gray-100 dark:bg-gray-800 text-gray-400 rounded-2xl border-2 resize-none ${canSend && isSubscribed
? 'border-green-200'
: 'border-red-200 opacity-50'
}`}
className={`flex-1 px-3 py-1 lg:px-5 lg:py-3 bg-gray-100 dark:bg-gray-800 text-gray-400 rounded-2xl border-2 resize-none ${
canSend && isSubscribed
? 'border-green-200'
: 'border-red-200 opacity-50'
}`}
rows={1}
disabled={!isSubscribed}
onKeyDown={(e) => {
Expand Down
10 changes: 5 additions & 5 deletions www/components/spinner.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from "react";
import { FaCircleNotch } from "react-icons/fa";
import React from 'react';
import { FaCircleNotch } from 'react-icons/fa';

const Spinner = ({ size = 24, color = "#000000" }) => {
const Spinner = ({ size = 24, color = '#000000' }) => {
const spinnerStyle = {
animation: "spin 1s linear infinite",
animation: 'spin 1s linear infinite',
color: color,
fontSize: `${size}px`,
};

return (
<div style={{ display: "inline-block" }}>
<div style={{ display: 'inline-block' }}>
<style>
{`
@keyframes spin {
Expand Down
Loading

0 comments on commit d78643a

Please sign in to comment.