Skip to content

Commit

Permalink
Update example and packages
Browse files Browse the repository at this point in the history
  • Loading branch information
NayamAmarshe committed Feb 7, 2024
1 parent 06d356d commit c44bab1
Show file tree
Hide file tree
Showing 19 changed files with 695 additions and 793 deletions.
6 changes: 1 addition & 5 deletions .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,4 @@ SAFE_BROWSING_API_KEY=""

# ENTER YOUR WEBSITE DOMAIN NAME HERE

NEXT_PUBLIC_BASE_URL="https://website.com/"

# DEFAULT CONFIG

RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED=false
NEXT_PUBLIC_BASE_URL="https://website.com/"
7 changes: 2 additions & 5 deletions atoms/cardsOpenState.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import { atom } from "recoil";
import { atom } from "jotai";

export const cardsOpenState = atom({
key: "cardsOpenState",
default: false,
});
export const cardsOpenState = atom(false);
7 changes: 2 additions & 5 deletions atoms/downloadQRCodeState.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import { atom } from "recoil";
import { atom } from "jotai";

export const downloadQRCodeState = atom({
key: "downloadQRCode",
default: false,
});
export const downloadQRCodeState = atom(false);
7 changes: 2 additions & 5 deletions atoms/linkSettingsOpenState.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import { atom } from "recoil";
import { atom } from "jotai";

export const linkSettingsOpenState = atom({
key: "linkSettingsOpenState",
default: false,
});
export const linkSettingsOpenState = atom(false);
7 changes: 2 additions & 5 deletions atoms/linksState.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import { atom } from "recoil";
import { atom } from "jotai";

export const linksState = atom({
key: "linksState",
default: [],
});
export const linksState = atom([]);
7 changes: 2 additions & 5 deletions atoms/navbarAtom.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import { atom } from "recoil";
import { atom } from "jotai";

export const navbarState = atom({
key: "navbarState",
default: false,
});
export const navbarState = atom(false);
4 changes: 2 additions & 2 deletions components/Layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import GridLoader from "react-spinners/GridLoader";
import React, { useEffect, useState } from "react";
import { navbarState } from "../atoms/navbarAtom";
import Navbar from "./right-sidebar/Navbar";
import { useRecoilState } from "recoil";
import { useAtom } from "jotai";

const Layout = ({ children }) => {
const [navbarOpen, setNavbarOpen] = useRecoilState(navbarState);
const [navbarOpen, setNavbarOpen] = useAtom(navbarState);
const [loading, setLoading] = useState(true);

useEffect(() => {
Expand Down
6 changes: 3 additions & 3 deletions components/bottom-sidebar/ScrollingCards.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React, { useEffect, useState } from "react";
import { BsFillXCircleFill } from "react-icons/bs";
import { HiOutlineQrcode } from "react-icons/hi";
import { useSwipeable } from "react-swipeable";
import { useRecoilState } from "recoil";
import { useAtom } from "jotai";
import { useTheme } from "next-themes";
import dynamic from "next/dynamic";

Expand All @@ -18,8 +18,8 @@ const ScrollingCards = () => {
const { theme, setTheme } = useTheme();

// !GLOBAL
const [cardsOpen, setCardsOpen] = useRecoilState(cardsOpenState);
const [links, setLinks] = useRecoilState(linksState);
const [cardsOpen, setCardsOpen] = useAtom(cardsOpenState);
const [links, setLinks] = useAtom(linksState);
const [qrCodeIndex, setQRCodeIndex] = useState(null);

const handlers = useSwipeable({
Expand Down
5 changes: 2 additions & 3 deletions components/home/LinkClipboard.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { downloadQRCodeState } from "../../atoms/downloadQRCodeState";
import { FiCopy } from "react-icons/fi";
import { useRecoilState } from "recoil";
import { useAtom } from "jotai";
import dynamic from "next/dynamic";
import React from "react";

Expand All @@ -9,8 +9,7 @@ const QRCode = dynamic(() => import("../bottom-sidebar/QRCode"), {
});

const LinkClipboard = ({ copyToClipboard, outputLink }) => {
const [downloadQRCode, setDownloadQRCode] =
useRecoilState(downloadQRCodeState);
const [downloadQRCode, setDownloadQRCode] = useAtom(downloadQRCodeState);

return (
<>
Expand Down
9 changes: 3 additions & 6 deletions components/home/LinkOptionsModal.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AiFillCheckCircle, AiFillCloseCircle } from "react-icons/ai";
import { downloadQRCodeState } from "../../atoms/downloadQRCodeState";
import { useRecoilState } from "recoil";
import { useAtom } from "jotai";
import { motion } from "framer-motion";
import { Backdrop } from "../Backdrop";
import React from "react";
Expand All @@ -12,8 +12,7 @@ const LinkOptionsModal = ({
setLinkSettingsOpen,
linkSettingsOpen,
}) => {
const [downloadQRCode, setDownloadQRCode] =
useRecoilState(downloadQRCodeState);
const [downloadQRCode, setDownloadQRCode] = useAtom(downloadQRCodeState);

return (
<Backdrop
Expand Down Expand Up @@ -42,9 +41,7 @@ const LinkOptionsModal = ({
</h4>
<div className="mt-2 flex h-full w-full flex-col items-center justify-center space-y-5 p-5">
<p className="w-52 truncate text-slate-400 dark:text-stone-400">
{customSlug.length < 1
? BASE_URL + "example"
: BASE_URL}
{customSlug.length < 1 ? BASE_URL + "example" : BASE_URL}
<span className="text-green-500">{customSlug.toLowerCase()}</span>
</p>
<input
Expand Down
4 changes: 2 additions & 2 deletions components/right-sidebar/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { useSwipeable } from "react-swipeable";
import { FaGithub } from "react-icons/fa";
import { SiBuymeacoffee } from "react-icons/si";
import { ImMail4 } from "react-icons/im";
import { useRecoilState } from "recoil";
import { useAtom } from "jotai";
import React, { useState } from "react";
import FAQSection from "./FAQSection";

const Navbar = () => {
const [navbarOpen, setNavbarOpen] = useRecoilState(navbarState);
const [navbarOpen, setNavbarOpen] = useAtom(navbarState);

const handlers = useSwipeable({
onSwipedRight: (e) => {
Expand Down
Loading

0 comments on commit c44bab1

Please sign in to comment.