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

fix boolean types, sidebar toggle state update improv #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 components/Comments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import NoResults from './NoResults';
import { IUser } from '../types';

interface IProps {
isPostingComment: Boolean;
isPostingComment: boolean;
comment: string;
setComment: Dispatch<SetStateAction<string>>;
addComment: (e: React.FormEvent) => void;
Expand Down
4 changes: 2 additions & 2 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React from 'react';
import { NextPage } from 'next';
import { footerList1, footerList2, footerList3 } from '../utils/constants';

const List = ({ items, mt }: { items: string[], mt: Boolean }) => (
const List = ({ items, mt }: { items: string[], mt: boolean }) => (
<div className={`flex flex-wrap gap-2 ${mt && 'mt-5'}`}>
{items.map((item: string) => (
<p key={item} className='text-gray-400 text-sm hover:underline cursor-pointer' >
<p key={item} className='text-gray-400 text-sm hover:underline cursor-pointer' >
{item}
</p>
))}
Expand Down
4 changes: 2 additions & 2 deletions components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Discover from './Discover';
import Footer from './Footer';
import useAuthStore from '../store/authStore';
const Sidebar: NextPage = () => {
const [showSidebar, setShowSidebar] = useState<Boolean>(true);
const [showSidebar, setShowSidebar] = useState<boolean>(true);
const { pathname } = useRouter();
const { fetchAllUsers, allUsers }: any = useAuthStore();

Expand All @@ -22,7 +22,7 @@ const Sidebar: NextPage = () => {
<div>
<div
className='block xl:hidden m-2 ml-4 mt-3 text-xl'
onClick={() => setShowSidebar(!showSidebar)}
onClick={() => setShowSidebar((showSidebar) => !showSidebar)}
>
{showSidebar ? <ImCancelCircle /> : <AiOutlineMenu />}
</div>
Expand Down
1 change: 0 additions & 1 deletion pages/api/auth.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { NextApiRequest, NextApiResponse } from 'next';

import { allUsersQuery } from './../../utils/queries';
import { client } from '../../utils/client';

export default async function handler(req: NextApiRequest, res: NextApiResponse) {
Expand Down
2 changes: 1 addition & 1 deletion pages/profile/[userId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface IProps {
}

const Profile = ({ data }: IProps) => {
const [showUserVideos, setShowUserVideos] = useState<Boolean>(true);
const [showUserVideos, setShowUserVideos] = useState<boolean>(true);
const [videosList, setVideosList] = useState<Video[]>([]);

const { user, userVideos, userLikedVideos } = data;
Expand Down
6 changes: 3 additions & 3 deletions pages/upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import { topics } from '../utils/constants';
const Upload = () => {
const [caption, setCaption] = useState('');
const [topic, setTopic] = useState<String>(topics[0].name);
const [loading, setLoading] = useState<Boolean>(false);
const [savingPost, setSavingPost] = useState<Boolean>(false);
const [loading, setLoading] = useState<boolean>(false);
const [savingPost, setSavingPost] = useState<boolean>(false);
const [videoAsset, setVideoAsset] = useState<SanityAssetDocument | undefined>();
const [wrongFileType, setWrongFileType] = useState<Boolean>(false);
const [wrongFileType, setWrongFileType] = useState<boolean>(false);

const userProfile: any = useAuthStore((state) => state.userProfile);
const router = useRouter();
Expand Down