Skip to content

Commit

Permalink
Kill Settings feature
Browse files Browse the repository at this point in the history
  • Loading branch information
insmac committed Sep 18, 2023
1 parent 8a48cd2 commit 0bf04f5
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 374 deletions.
30 changes: 0 additions & 30 deletions packages/web-console/src/providers/LocalStorageProvider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ const defaultConfig: LocalConfig = {
authPayload: "",
editorCol: 10,
editorLine: 10,
isNotificationEnabled: true,
notificationDelay: 5,
editorSplitterBasis: 350,
resultsSplitterBasis: 350,
exampleQueriesVisited: false,
Expand All @@ -51,8 +49,6 @@ type ContextProps = {
authPayload: string
editorCol: number
editorLine: number
notificationDelay: number
isNotificationEnabled: boolean
editorSplitterBasis: number
resultsSplitterBasis: number
updateSettings: (key: StoreKey, value: SettingsType) => void
Expand All @@ -63,8 +59,6 @@ const defaultValues: ContextProps = {
authPayload: "",
editorCol: 1,
editorLine: 1,
isNotificationEnabled: true,
notificationDelay: 5,
editorSplitterBasis: 350,
resultsSplitterBasis: 350,
updateSettings: (key: StoreKey, value: SettingsType) => undefined,
Expand All @@ -85,18 +79,6 @@ export const LocalStorageProvider = ({
const [editorLine, setEditorLine] = useState<number>(
parseInteger(getValue(StoreKey.EDITOR_LINE), defaultConfig.editorLine),
)
const [isNotificationEnabled, setIsNotificationEnabled] = useState<boolean>(
parseBoolean(
getValue(StoreKey.NOTIFICATION_ENABLED),
defaultConfig.isNotificationEnabled,
),
)
const [notificationDelay, setNotificationDelay] = useState<number>(
parseInteger(
getValue(StoreKey.NOTIFICATION_DELAY),
defaultConfig.notificationDelay,
),
)
const [editorSplitterBasis, seteditorSplitterBasis] = useState<number>(
parseInteger(
getValue(StoreKey.EDITOR_SPLITTER_BASIS),
Expand Down Expand Up @@ -134,16 +116,6 @@ export const LocalStorageProvider = ({
case StoreKey.EXAMPLE_QUERIES_VISITED:
setExampleQueriesVisited(value === "true")
break
case StoreKey.NOTIFICATION_ENABLED:
setIsNotificationEnabled(
parseBoolean(value, defaultConfig.isNotificationEnabled),
)
break
case StoreKey.NOTIFICATION_DELAY:
setNotificationDelay(
parseInteger(value, defaultConfig.notificationDelay),
)
break
case StoreKey.EDITOR_SPLITTER_BASIS:
seteditorSplitterBasis(
parseInteger(value, defaultConfig.editorSplitterBasis),
Expand All @@ -163,8 +135,6 @@ export const LocalStorageProvider = ({
authPayload,
editorCol,
editorLine,
isNotificationEnabled,
notificationDelay,
editorSplitterBasis,
resultsSplitterBasis,
updateSettings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ export type LocalConfig = {
authPayload: string
editorCol: number
editorLine: number
notificationDelay: number
isNotificationEnabled: boolean
editorSplitterBasis: number
resultsSplitterBasis: number
exampleQueriesVisited: boolean
Expand Down
5 changes: 0 additions & 5 deletions packages/web-console/src/scenes/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { BusEvent } from "../../consts"
import Footer from "../Footer"
import Console from "../Console"
import Import from "../Import"
import Settings from "../Settings"
import News from "../News"
import SideMenu from "../SideMenu"
import { QuestProvider } from "../../providers"
Expand Down Expand Up @@ -67,10 +66,6 @@ const Layout = () => {
<Import />
</Page>

<Page style={{ display: activePanel === "settings" ? "flex" : "none" }}>
<Settings />
</Page>

<Page style={{ display: activePanel === "news" ? "flex" : "none" }}>
<News />
</Page>
Expand Down
7 changes: 0 additions & 7 deletions packages/web-console/src/scenes/Notifications/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import React, {
useCallback,
useContext,
useState,
useEffect,
useRef,
Expand All @@ -42,7 +41,6 @@ import {
useScreenSize,
} from "../../components"
import { actions, selectors } from "../../store"
import { LocalStorageContext } from "../../providers/LocalStorageProvider"
import { TerminalBox, Subtract, ArrowUpS } from "styled-icons/remix-line"

import Notification from "./Notification"
Expand Down Expand Up @@ -86,7 +84,6 @@ const ClearAllNotificationsButton = styled(SecondaryButton)`

const Notifications = () => {
const notifications = useSelector(selectors.query.getNotifications)
const { isNotificationEnabled } = useContext(LocalStorageContext)
const { sm } = useScreenSize()
const [isMinimized, setIsMinimized] = useState(true)
const contentRef = useRef<HTMLDivElement | null>(null)
Expand Down Expand Up @@ -122,10 +119,6 @@ const Notifications = () => {
}
}, [sm])

if (!isNotificationEnabled) {
return <></>
}

return (
<Wrapper minimized={isMinimized} data-hook="notifications-wrapper">
<Menu>
Expand Down

This file was deleted.

This file was deleted.

65 changes: 0 additions & 65 deletions packages/web-console/src/scenes/Settings/Notifications/index.tsx

This file was deleted.

Loading

0 comments on commit 0bf04f5

Please sign in to comment.