Skip to content

Commit

Permalink
add sweep update and lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hellno committed Sep 3, 2023
1 parent 30c5def commit 6fab696
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 28 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"build": "cross-env INLINE_RUNTIME_CHUNK=true NODE_OPTIONS=--max-old-space-size=8192 yarn vite build",
"preview": "vite preview",
"serve": "serve -s build",
"preinstall": "yarn global add serve"
"preinstall": "yarn global add serve",
"lint": "eslint --ext .js,.jsx,.ts,.tsx src",
"lint:fix": "eslint --fix --ext .js,.jsx,.ts,.tsx src"
},
"eslintConfig": {
"extends": [
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Login/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from 'react'
import { Auth } from '@supabase/auth-ui-react';
import { ThemeSupa } from '@supabase/auth-ui-shared'
import { supabaseClient } from '@/common/helpers/supabase';
import { useEffect, useState } from 'react';
import { Session } from '@supabase/supabase-js';
import { hydrate } from '@/stores/useAccountStore';
import { useNavigate, useLocation } from "react-router-dom";
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Notifications/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react'

import { classNames } from '@/common/helpers/css'
import { useEffect, useState } from 'react'
import { fetchCasts, getNeynarNotificationsEndpoint } from '@/common/helpers/neynar'
import { useAccountStore } from '@/stores/useAccountStore'
import { SelectableListWithHotkeys } from '@/common/components/SelectableListWithHotkeys'
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function Settings() {
if (session) {
resetStore();
setUser(null);
const res = await supabaseClient.auth.signOut();
await supabaseClient.auth.signOut();
}

navigate('/login');
Expand All @@ -44,7 +44,7 @@ export default function Settings() {
const displayEmail = user?.email ? `${user?.email.slice(0, 5)}...@${user?.email.split('@')[1]}` : '';

const renderInfoSection = () => {
let commands: SimpleCommand[] = [
const commands: SimpleCommand[] = [
{ name: 'Command Palette', shortcut: 'cmd+k' },
{ name: 'Feed: go to previous cast in list', shortcut: 'k' },
{ name: 'Feed: go to next cast in list', shortcut: 'j' },
Expand Down
4 changes: 2 additions & 2 deletions src/stores/useAccountStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ const switchAccountTo = (idx: number) => {
};

const getAccountCommands = () => {
let accountCommands: CommandType[] = [];
const accountCommands: CommandType[] = [];

for (let i = 0; i < 9; i++) {
accountCommands.push({
Expand All @@ -208,7 +208,7 @@ const getAccountCommands = () => {
};

const getChannelCommands = () => {
let channelCommands: CommandType[] = [];
const channelCommands: CommandType[] = [];

channelCommands.push({
name: `Switch to follow feed`,
Expand Down
40 changes: 20 additions & 20 deletions src/stores/useNavigationStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ const store = (set: StoreSet) => ({
state.isCommandPaletteOpen = !state.isCommandPaletteOpen;
});
},
toAccounts: () => {
set((state) => {
console.log('useNavStore: toAccounts');
// state.mainNavigation = MAIN_NAVIGATION_ENUM.ACCOUNTS;
redirect(`/${MAIN_NAVIGATION_ENUM.ACCOUNTS}`)
});
},
toFeed: () => {
set((state) => {
// state.mainNavigation = MAIN_NAVIGATION_ENUM.FEED;
redirect(`/${MAIN_NAVIGATION_ENUM.FEED}`)
});
},
// toAccounts: () => {
// set((state) => {
// console.log('useNavStore: toAccounts');
// // state.mainNavigation = MAIN_NAVIGATION_ENUM.ACCOUNTS;
// redirect(`/${MAIN_NAVIGATION_ENUM.ACCOUNTS}`)
// });
// },
// toFeed: () => {
// set((state) => {
// // state.mainNavigation = MAIN_NAVIGATION_ENUM.FEED;
// redirect(`/${MAIN_NAVIGATION_ENUM.FEED}`)
// });
// },
// toNewPost: () => {
// set((state) => {
// state.mainNavigation = MAIN_NAVIGATION_ENUM.NEW_POST;
Expand All @@ -61,12 +61,12 @@ const store = (set: StoreSet) => ({
// state.mainNavigation = MAIN_NAVIGATION_ENUM.REPLIES;
// });
// },
toSettings: () => {
set((state) => {
console.log('useNavStore: toSettings')
// state.mainNavigation = MAIN_NAVIGATION_ENUM.SETTINGS;
redirect(`/${MAIN_NAVIGATION_ENUM.FEED}`)
});
},
// toSettings: () => {
// set((state) => {
// console.log('useNavStore: toSettings')
// // state.mainNavigation = MAIN_NAVIGATION_ENUM.SETTINGS;
// redirect(`/${MAIN_NAVIGATION_ENUM.FEED}`)
// });
// },
});
export const useNavigationStore = create<NavigationStore>()(devtools(mutative(store)));
2 changes: 1 addition & 1 deletion src/stores/useNewPostStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const store = (set: StoreSet) => ({
})).then((res) => {
if (res.error) {
console.log('publishPostdraft error:', res.error);
return;
return
}
trackEventWithProperties('publish_post', { authorFid: account.platformAccountId });
state.removePostDraft(draftIdx);
Expand Down
5 changes: 5 additions & 0 deletions sweep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ docs:
hub-nodejs: ["https://github.com/farcasterxyz/hub-monorepo/blob/main/packages/hub-nodejs/docs/README.md", "We use hub monorepo nodejs web to interact with the Farcaster protocol"]
react-js: ["https://react.dev/reference/react", "We use react js as our frontend framework"]
tauri: ["https://tauri.app/v1/", "Tauri is our vector database"]
sandbox:
enabled: true
image: "Nodejs"
install: "yarn install"
formatter: "yarn run lint:fix"

0 comments on commit 6fab696

Please sign in to comment.