Skip to content

Commit

Permalink
Visualizer: Use toaster in SnippetExplorer from AppContext
Browse files Browse the repository at this point in the history
  • Loading branch information
obadakhalili committed Nov 14, 2021
1 parent 9b2d36e commit ea9a351
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/visualizer/src/Workspace/SnippetExplorer.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
// TODO: Implement edit snippet functionality

import React, { SyntheticEvent } from "react"
import React, { SyntheticEvent, useContext } from "react"
import { useRecoilState, useRecoilValue } from "recoil"
import {
Select,
ItemPredicate,
ItemRenderer,
ItemsEqualComparator,
} from "@blueprintjs/select"
import { Button, MenuItem, Icon, Toaster, Intent } from "@blueprintjs/core"
import { Button, MenuItem, Icon, Intent } from "@blueprintjs/core"

// TODO: Find better jokes library
import { getRandomJoke } from "awesome-dev-jokes"

import { snippetsState, activeSnippetState, Snippet } from "../state"
import { AppContext } from ".."

export enum SnippetRules {
SNIPPETS_MAX_LENGTH = 20,
Expand Down Expand Up @@ -65,11 +66,10 @@ const composeSnippetFromQuery = (query: string) => ({
value: `// ${getRandomJoke()}`,
})

const toast = Toaster.create()

export default function SnippetExplorer() {
const [snippets, setSnippets] = useRecoilState(snippetsState)
const activeSnippet = useRecoilValue(activeSnippetState)
const { toast } = useContext(AppContext)

return (
<SnippetSelect
Expand Down

0 comments on commit ea9a351

Please sign in to comment.