This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const UserContext = React.createContext(null); | |
const IndexPage = () => { | |
const [session, setSession] = useState(null); | |
useEffect(() => { | |
(async () => { | |
const getUser = await fetch(`/api/session`, { | |
headers: { Authorization: `Bearer ${getCookie("jwt")}` }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { EmotionCache } from "@emotion/react"; | |
import { MantineProvider } from "@mantine/core"; | |
import createCache from "@emotion/cache"; | |
const dynamicStyleTagsIDs = []; | |
const usedStyleTagIDs = {}; | |
// to render this element in every instance of: <div role="textbox">...</div> | |
export const getInlineAnchorList: PlasmoGetInlineAnchorList = async () => | |
document.querySelectorAll(`div[role="textbox"]`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import createCache from "@emotion/cache" | |
import { Button, Image, MantineProvider, Popover, Text } from "@mantine/core" | |
import { NotificationsProvider, showNotification } from "@mantine/notifications" | |
import type { PlasmoContentScript, PlasmoGetInlineAnchor } from "plasmo" | |
import type { PlasmoGetStyle } from "plasmo" | |
import React, { useEffect, useRef, useState } from "react" | |
import Fade from "react-reveal/Fade" | |
import AppModal from "~components/appModal" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NextApiRequest, NextApiResponse } from "next"; | |
const handler = async (req: NextApiRequest, res: NextApiResponse) => { | |
try { | |
// we'll check the request method so we can choose what we want to do | |
switch (req.method) { | |
case "GET": | |
// url for executing: SELECT * FROM todo | |
const getTodos = await fetch( | |
"https://api.withserve.com/v1/workflows/7cb831a8-2507-4e46-84d1-5bbc25419fb5?apiKey=9c2fb0d1-bbaf-4d78-a58d-2b590622cc6c", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NextApiRequest, NextApiResponse } from "next"; | |
const handler = async (req: NextApiRequest, res: NextApiResponse) => { | |
try { | |
// we'll check the request method so we can choose what we want to do | |
switch (req.method) { | |
case "GET": | |
// url for executing: SELECT * FROM todo | |
const getTodos = await fetch( | |
"https://api.withserve.com/v1/workflows/7cb831a8-2507-4e46-84d1-5bbc25419fb5?apiKey=9c2fb0d1-bbaf-4d78-a58d-2b590622cc6c", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
Box, | |
Button, | |
Center, | |
createStyles, | |
Input, | |
Text, | |
Title, | |
} from "@mantine/core"; | |
import React, { useEffect, useState } from "react"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Box, Button, Center, Input, Title } from "@mantine/core"; | |
import React, { useEffect, useState } from "react"; | |
const IndexPage = () => { | |
const [newTodo, setNewTodo] = useState(""); | |
const [todos, setTodos] = useState<{ id: string; task: string }[]>([]); | |
useEffect(() => { | |
(async () => { | |
const getTodos = await fetch(`/api/todos`, { method: "GET" }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NextApiRequest, NextApiResponse } from "next"; | |
const handler = async (req: NextApiRequest, res: NextApiResponse) => { | |
try { | |
switch (req.method) { | |
case "GET": | |
const getTodos = await fetch( | |
"https://api.withserve.com/v1/workflows/7cb831a8-2507-4e46-84d1-5bbc25419fb5?apiKey=9c2fb0d1-bbaf-4d78-a58d-2b590622cc6c", | |
{ method: req.method } | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Box, Button, Center, Input, Title } from "@mantine/core"; | |
import React, { useState } from "react"; | |
const IndexPage = () => { | |
const [newTodo, setNewTodo] = useState(""); | |
const [todos, setTodos] = useState<string[]>([]); | |
return ( | |
<Center style={{ flexDirection: "column", padding: 10 }}> | |
<Title>Next.js + Serve todo app</Title> |
NewerOlder