kopia lustrzana https://github.com/bugout-dev/moonstream
Prettier fixes
rodzic
5770057838
commit
c4ce547a1a
|
@ -24,7 +24,7 @@ const AccountIconButton = (props) => {
|
|||
{...props}
|
||||
as={IconButton}
|
||||
aria-label="Account menu"
|
||||
icon={<RiAccountCircleLine size="26px"/>}
|
||||
icon={<RiAccountCircleLine size="26px" />}
|
||||
// variant="outline"
|
||||
color="gray.100"
|
||||
/>
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import { jsx } from "@emotion/react";
|
||||
import { useUser, useRouter } from "../core/hooks";
|
||||
import { useEffect, Fragment, useState } from "react";
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import { jsx } from "@emotion/react";
|
||||
import { useState, useEffect } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import { jsx } from "@emotion/react";
|
||||
import { GridItem } from "@chakra-ui/react";
|
||||
import { Heading, Text, Image } from "@chakra-ui/react";
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import { Fragment } from "react";
|
||||
import { jsx } from "@emotion/react";
|
||||
import {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import { jsx } from "@emotion/react";
|
||||
import {
|
||||
Button,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/** @jsx jsx */
|
||||
import { jsx } from "@emotion/react";
|
||||
import { Flex, Heading, Text, Link } from "@chakra-ui/react";
|
||||
import CustomIcon from "../components/CustomIcon"
|
||||
import CustomIcon from "../components/CustomIcon";
|
||||
import RouterLink from "next/link";
|
||||
|
||||
const ICONS = [
|
||||
|
@ -14,8 +14,7 @@ const ICONS = [
|
|||
{ social: "twit", link: "https://twitter.com/Bugout_dev" },
|
||||
{
|
||||
social: "slack",
|
||||
link:
|
||||
"https://join.slack.com/t/bugout-dev/shared_invite/zt-fhepyt87-5XcJLy0iu702SO_hMFKNhQ",
|
||||
link: "https://join.slack.com/t/bugout-dev/shared_invite/zt-fhepyt87-5XcJLy0iu702SO_hMFKNhQ",
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@ import {
|
|||
Input,
|
||||
InputRightElement,
|
||||
} from "@chakra-ui/react";
|
||||
import CustomIcon from "./CustomIcon"
|
||||
import Modal from "./Modal"
|
||||
import CustomIcon from "./CustomIcon";
|
||||
import Modal from "./Modal";
|
||||
|
||||
const ForgotPassword = ({ toggleModal }) => {
|
||||
const toast = useToast();
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import { jsx } from "@emotion/react";
|
||||
import { Heading, Box, Text, Center, VStack } from "@chakra-ui/react";
|
||||
const Page404 = () => (
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import { jsx } from "@emotion/react";
|
||||
import { Heading, Box, Text, VStack, Center } from "@chakra-ui/react";
|
||||
const Page403 = ({ location }) => (
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import { jsx } from "@emotion/react";
|
||||
import Head from "next/head";
|
||||
import propTypes from "prop-types";
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import { jsx } from "@emotion/react";
|
||||
import Head from "next/head";
|
||||
import propTypes from "prop-types";
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import { jsx } from "@emotion/react";
|
||||
import { IconButton as IconButtonChakra } from "@chakra-ui/react";
|
||||
import { CheckIcon } from "@chakra-ui/icons";
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import { jsx } from "@emotion/react";
|
||||
import { useState, useEffect } from "react";
|
||||
import { Text } from "@chakra-ui/react";
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/** @jsx jsx */
|
||||
import { jsx } from "@emotion/react";
|
||||
import { Flex } from "@chakra-ui/react";
|
||||
import CustomIcon from "../CustomIcon"
|
||||
import CustomIcon from "../CustomIcon";
|
||||
import styles from "./styles";
|
||||
|
||||
const Modal = ({ children, onClose }) => (
|
||||
|
|
|
@ -13,7 +13,6 @@ const AppNavbar = React.lazy(() => import("./AppNavbar"));
|
|||
const Navbar = () => {
|
||||
const { modal, toggleModal, isAppView, isLoggedIn } = useContext(UIContext);
|
||||
|
||||
|
||||
return (
|
||||
<Flex
|
||||
boxShadow={["sm", "md"]}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { useState } from "react";
|
||||
import { InputGroup, InputRightElement, Input } from "@chakra-ui/react";
|
||||
import CustomIcon from "./CustomIcon"
|
||||
import CustomIcon from "./CustomIcon";
|
||||
|
||||
const PasswordInput = ({ placeholder, name }, ref) => {
|
||||
const [showPassword, togglePassword] = useState(false);
|
||||
|
|
|
@ -8,7 +8,7 @@ const RadioCard = (props) => {
|
|||
const checkbox = getCheckboxProps();
|
||||
|
||||
return (
|
||||
<Flex as="label" h="fill-availible" onClick={() => console.log('hello2')}>
|
||||
<Flex as="label" h="fill-availible" onClick={() => console.log("hello2")}>
|
||||
<input {...input} />
|
||||
<Box
|
||||
justifyContent="left"
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
Input,
|
||||
InputRightElement,
|
||||
} from "@chakra-ui/react";
|
||||
import CustomIcon from "./CustomIcon"
|
||||
import CustomIcon from "./CustomIcon";
|
||||
import { useLogin } from "../core/hooks";
|
||||
import PasswordInput from "./PasswordInput";
|
||||
import Modal from "./Modal";
|
||||
|
@ -51,7 +51,7 @@ const SignIn = ({ toggleModal }) => {
|
|||
colorScheme="primary"
|
||||
placeholder="Your Bugout username"
|
||||
name="username"
|
||||
{...register('username', { required: true })}
|
||||
{...register("username", { required: true })}
|
||||
ref={register({ required: "Username is required!" })}
|
||||
/>
|
||||
<InputRightElement>
|
||||
|
|
|
@ -2,9 +2,8 @@ import AnalyticsContext from "../providers/AnalyticsProvider/context";
|
|||
import { useContext } from "react";
|
||||
import { useState, useEffect, useCallback } from "react";
|
||||
const useAnalytics = () => {
|
||||
const { mixpanel, isLoaded, MIXPANEL_EVENTS, MIXPANEL_PROPS } = useContext(
|
||||
AnalyticsContext
|
||||
);
|
||||
const { mixpanel, isLoaded, MIXPANEL_EVENTS, MIXPANEL_PROPS } =
|
||||
useContext(AnalyticsContext);
|
||||
const [trackProps, setTrackProps] = useState({
|
||||
event: null,
|
||||
props: null,
|
||||
|
|
|
@ -36,10 +36,12 @@ const useLogin = (loginType) => {
|
|||
getUser();
|
||||
if (analytics.isLoaded) {
|
||||
analytics.mixpanel.people.set_once({
|
||||
[`${analytics.MIXPANEL_EVENTS.FIRST_LOGIN_DATE}`]: new Date().toISOString(),
|
||||
[`${analytics.MIXPANEL_EVENTS.FIRST_LOGIN_DATE}`]:
|
||||
new Date().toISOString(),
|
||||
});
|
||||
analytics.mixpanel.people.set({
|
||||
[`${analytics.MIXPANEL_EVENTS.LAST_LOGIN_DATE}`]: new Date().toISOString(),
|
||||
[`${analytics.MIXPANEL_EVENTS.LAST_LOGIN_DATE}`]:
|
||||
new Date().toISOString(),
|
||||
});
|
||||
analytics.mixpanel.track(
|
||||
`${analytics.MIXPANEL_EVENTS.USER_LOGS_IN}`,
|
||||
|
|
|
@ -8,7 +8,7 @@ const useLogout = () => {
|
|||
const { setLoggingOut } = useContext(UIContext);
|
||||
const router = useRouter();
|
||||
const analytics = useAnalytics();
|
||||
const {mutate: revoke, data } = useMutation(AuthService.revoke, {
|
||||
const { mutate: revoke, data } = useMutation(AuthService.revoke, {
|
||||
onSuccess: () => {
|
||||
if (analytics.isLoaded) {
|
||||
analytics.mixpanel.track(
|
||||
|
|
|
@ -15,10 +15,13 @@ const useSignUp = (source) => {
|
|||
isLoading,
|
||||
error,
|
||||
data,
|
||||
isSuccess
|
||||
isSuccess,
|
||||
} = useMutation(AuthService.register(), {
|
||||
onSuccess: (response) => {
|
||||
localStorage.setItem("MOONSTREAM_ACCESS_TOKEN", response.data.access_token);
|
||||
localStorage.setItem(
|
||||
"MOONSTREAM_ACCESS_TOKEN",
|
||||
response.data.access_token
|
||||
);
|
||||
const invite_code = window.sessionStorage.getItem("invite_code");
|
||||
if (invite_code) {
|
||||
inviteAccept(invite_code);
|
||||
|
|
|
@ -58,8 +58,7 @@ const useJournalEntries = ({
|
|||
getNextPageParam: (lastGroup) => {
|
||||
return lastGroup.next_offset === null ? false : lastGroup.next_offset;
|
||||
},
|
||||
onSuccess: (data) => {
|
||||
},
|
||||
onSuccess: (data) => {},
|
||||
enabled: !!enabled,
|
||||
});
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import { jsx } from "@emotion/react";
|
||||
import { useToast as useChakraToast, Box } from "@chakra-ui/react";
|
||||
import { useCallback } from "react";
|
||||
|
|
|
@ -50,20 +50,19 @@ export const getTokens = (humbugId) => {
|
|||
});
|
||||
};
|
||||
|
||||
export const createRestrictedToken = (humbugId) => ({
|
||||
appName,
|
||||
appVersion,
|
||||
}) => {
|
||||
const data = new FormData();
|
||||
data.append("app_name", appName);
|
||||
data.append("app_version", appVersion);
|
||||
export const createRestrictedToken =
|
||||
(humbugId) =>
|
||||
({ appName, appVersion }) => {
|
||||
const data = new FormData();
|
||||
data.append("app_name", appName);
|
||||
data.append("app_version", appVersion);
|
||||
|
||||
return http({
|
||||
method: "POST",
|
||||
url: `${API}/humbug/${humbugId}/tokens`,
|
||||
data,
|
||||
});
|
||||
};
|
||||
return http({
|
||||
method: "POST",
|
||||
url: `${API}/humbug/${humbugId}/tokens`,
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
export const deleteRestrictedToken = (humbugId) => (tokenId) => {
|
||||
const data = new FormData();
|
||||
|
|
|
@ -62,35 +62,31 @@ export const getJournalsScopes = () => {
|
|||
});
|
||||
};
|
||||
|
||||
export const setJournalPermission = (journalId) => ({
|
||||
holder_type,
|
||||
holder_id,
|
||||
permission_list,
|
||||
}) => {
|
||||
const data = new FormData();
|
||||
data.append("holder_type", holder_type);
|
||||
data.append("holder_id", holder_id);
|
||||
data.append("permission_list", permission_list);
|
||||
export const setJournalPermission =
|
||||
(journalId) =>
|
||||
({ holder_type, holder_id, permission_list }) => {
|
||||
const data = new FormData();
|
||||
data.append("holder_type", holder_type);
|
||||
data.append("holder_id", holder_id);
|
||||
data.append("permission_list", permission_list);
|
||||
|
||||
return http({
|
||||
method: "POST",
|
||||
url: `${API}/journals/${journalId}/scopes`,
|
||||
data: { holder_type, holder_id, permission_list },
|
||||
});
|
||||
};
|
||||
return http({
|
||||
method: "POST",
|
||||
url: `${API}/journals/${journalId}/scopes`,
|
||||
data: { holder_type, holder_id, permission_list },
|
||||
});
|
||||
};
|
||||
|
||||
export const deleteJournalPermission = (journalId) => ({
|
||||
holder_type,
|
||||
holder_id,
|
||||
permission_list,
|
||||
}) => {
|
||||
return http({
|
||||
method: "DELETE",
|
||||
url: `${API}/journals/${journalId}/scopes`,
|
||||
data: { holder_type, holder_id, permission_list },
|
||||
// permission_list: ["read"]
|
||||
});
|
||||
};
|
||||
export const deleteJournalPermission =
|
||||
(journalId) =>
|
||||
({ holder_type, holder_id, permission_list }) => {
|
||||
return http({
|
||||
method: "DELETE",
|
||||
url: `${API}/journals/${journalId}/scopes`,
|
||||
data: { holder_type, holder_id, permission_list },
|
||||
// permission_list: ["read"]
|
||||
});
|
||||
};
|
||||
|
||||
export const getPublicJournals = () =>
|
||||
http({
|
||||
|
@ -98,32 +94,30 @@ export const getPublicJournals = () =>
|
|||
url: `${API}/public/`,
|
||||
});
|
||||
|
||||
export const searchEntries = ({ journalId }) => ({
|
||||
searchTerm,
|
||||
limit,
|
||||
offset,
|
||||
isContent,
|
||||
journalType,
|
||||
}) => {
|
||||
const journalScope = journalType === "personal" ? "journals" : "public";
|
||||
return http({
|
||||
method: "GET",
|
||||
url: `${API}/${journalScope}/${journalId}/search`,
|
||||
params: {
|
||||
// filters: searchTags,
|
||||
q: searchTerm,
|
||||
limit: encodeURIComponent(limit),
|
||||
offset: encodeURIComponent(offset),
|
||||
content: encodeURIComponent(isContent),
|
||||
},
|
||||
});
|
||||
};
|
||||
export const searchEntries =
|
||||
({ journalId }) =>
|
||||
({ searchTerm, limit, offset, isContent, journalType }) => {
|
||||
const journalScope = journalType === "personal" ? "journals" : "public";
|
||||
return http({
|
||||
method: "GET",
|
||||
url: `${API}/${journalScope}/${journalId}/search`,
|
||||
params: {
|
||||
// filters: searchTags,
|
||||
q: searchTerm,
|
||||
limit: encodeURIComponent(limit),
|
||||
offset: encodeURIComponent(offset),
|
||||
content: encodeURIComponent(isContent),
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
export const publicSearchEntries = ({ journalId }) => (query) =>
|
||||
http({
|
||||
method: "GET",
|
||||
url: `${API}/public/${journalId}/search?q=${query}`,
|
||||
});
|
||||
export const publicSearchEntries =
|
||||
({ journalId }) =>
|
||||
(query) =>
|
||||
http({
|
||||
method: "GET",
|
||||
url: `${API}/public/${journalId}/search?q=${query}`,
|
||||
});
|
||||
|
||||
export const getPublicJournal = (key, { journalId }) =>
|
||||
http({
|
||||
|
@ -131,9 +125,11 @@ export const getPublicJournal = (key, { journalId }) =>
|
|||
url: `${API}/public/${journalId}`,
|
||||
});
|
||||
|
||||
export const getJournalStats = (key, { journalId }) => () =>
|
||||
http({
|
||||
method: "GET",
|
||||
url: `${API}/journals/${journalId}/stats`,
|
||||
params: { stats_version: 5 },
|
||||
});
|
||||
export const getJournalStats =
|
||||
(key, { journalId }) =>
|
||||
() =>
|
||||
http({
|
||||
method: "GET",
|
||||
url: `${API}/journals/${journalId}/stats`,
|
||||
params: { stats_version: 5 },
|
||||
});
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import { jsx } from "@emotion/react";
|
||||
import { Box } from "@chakra-ui/react";
|
||||
import { getLayout as getSiteLayout } from "./AppLayout";
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import { Flex } from "@chakra-ui/react";
|
||||
import { getLayout as getSiteLayout } from "./RootLayout";
|
||||
import React, { useContext } from "react";
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import { jsx } from "@emotion/react";
|
||||
import { Scrollable, Footer } from "../components";
|
||||
import { getLayout as getSiteLayout } from "./index";
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import { jsx } from "@emotion/react";
|
||||
import { Flex, Spinner } from "@chakra-ui/react";
|
||||
import React, { Suspense, useContext, useState, useEffect } from "react";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import Footer from "../components/Footer"
|
||||
import Scrollable from "../components/Scrollable"
|
||||
import Footer from "../components/Footer";
|
||||
import Scrollable from "../components/Scrollable";
|
||||
import RootLayout from "./RootLayout";
|
||||
|
||||
const LayoutWrapper = ({ children }) => {
|
||||
|
|
Ładowanie…
Reference in New Issue