Skip to content

Commit

Permalink
feat: enable ai
Browse files Browse the repository at this point in the history
  • Loading branch information
AykutSarac authored and zoosphar committed Jan 23, 2024
1 parent f276932 commit 4eba0dc
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 79 deletions.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
"analyze": "ANALYZE=true npm run build"
},
"dependencies": {
"@mantine/code-highlight": "^7.4.2",
"@mantine/core": "^7.4.2",
"@mantine/hooks": "^7.4.2",
"@mantine/code-highlight": "^7.4.1",
"@mantine/core": "^7.4.1",
"@mantine/hooks": "^7.4.1",
"@monaco-editor/react": "^4.6.0",
"@sentry/nextjs": "^7.94.1",
"@supabase/auth-helpers-nextjs": "^0.8.7",
"@supabase/auth-helpers-react": "^0.4.2",
"@supabase/supabase-js": "^2.39.3",
"@tanstack/react-query": "^4.36.1",
"allotment": "^1.20.0",
"allotment": "^1.19.5",
"axios": "^1.6.5",
"dayjs": "^1.11.10",
"gofmt.js": "^0.0.2",
Expand All @@ -44,7 +44,7 @@
"lodash.update": "^4.10.2",
"maketypes": "^1.1.2",
"million": "^2.6.4",
"next": "14.1.0",
"next": "13.5.6",
"pako": "^2.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand All @@ -59,7 +59,7 @@
"styled-components": "^6.1.8",
"toml": "^3.0.0",
"use-long-press": "^3.2.0",
"zustand": "^4.5.0"
"zustand": "^4.4.7"
},
"devDependencies": {
"@next/bundle-analyzer": "^14.1.0",
Expand All @@ -72,16 +72,16 @@
"@types/lodash.set": "^4.3.9",
"@types/lodash.unset": "^4.5.9",
"@types/lodash.update": "^4.10.9",
"@types/node": "^20.11.5",
"@types/node": "^20.4.7",
"@types/pako": "^2.0.3",
"@types/react": "18.2.48",
"@types/react": "18.2.45",
"@types/react-dom": "^18.2.18",
"eslint": "8.56.0",
"eslint-config-next": "14.1.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-next": "14.0.4",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-unused-imports": "^3.0.0",
"prettier": "^3.2.4",
"prettier": "^3.2.2",
"ts-node": "^10.9.2",
"typescript": "5.3.3"
}
Expand Down
94 changes: 48 additions & 46 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 2 additions & 11 deletions src/components/PromptInput/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
import React from "react";
import {
ActionIcon,
TextInput,
Text,
Loader,
Tooltip,
HoverCard,
Flex,
Badge,
} from "@mantine/core";
import { ActionIcon, TextInput, Loader, Tooltip, HoverCard, Flex, Badge } from "@mantine/core";
import { getHotkeyHandler } from "@mantine/hooks";
import styled from "styled-components";
import { FunctionsHttpError } from "@supabase/supabase-js";
Expand Down Expand Up @@ -95,7 +86,7 @@ export const PromptInput = () => {
}
};

if (!promptVisible) return null;
if (!promptVisible || !premium) return null;

return (
<Tooltip
Expand Down
26 changes: 15 additions & 11 deletions src/containers/Toolbar/OptionsMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import { Menu, Text, Flex, Badge } from "@mantine/core";
import { BsCheck2 } from "react-icons/bs";
import { MdSettings } from "react-icons/md";
import useConfig from "src/store/useConfig";
import useUser from "src/store/useUser";
import * as Styles from "./styles";

export const OptionsMenu = () => {
const premium = useUser(state => state.premium);
const toggleGestures = useConfig(state => state.toggleGestures);
const toggleChildrenCount = useConfig(state => state.toggleChildrenCount);
const toggleDarkMode = useConfig(state => state.toggleDarkMode);
Expand Down Expand Up @@ -68,17 +70,19 @@ export const OptionsMenu = () => {
>
<Text size="xs">Dark Mode</Text>
</Menu.Item>
<Menu.Item
leftSection={<BsCheck2 opacity={aiEnabled ? 100 : 0} />}
onClick={() => toggleAI(!aiEnabled)}
>
<Text size="xs">
JSON Crack AI{" "}
<Badge ml={2} size="xs" variant="light" radius={2}>
Alpha
</Badge>
</Text>
</Menu.Item>
{premium && (
<Menu.Item
leftSection={<BsCheck2 opacity={aiEnabled ? 100 : 0} />}
onClick={() => toggleAI(!aiEnabled)}
>
<Text size="xs">
JSON Crack AI{" "}
<Badge ml={2} size="xs" variant="light" radius={2}>
Alpha
</Badge>
</Text>
</Menu.Item>
)}
</Menu.Dropdown>
</Menu>
);
Expand Down

0 comments on commit 4eba0dc

Please sign in to comment.