mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-25 11:59:11 +00:00
chore: move contexts into their own folder
This commit is contained in:
parent
520b1c46fe
commit
980f0cee60
12 changed files with 10 additions and 10 deletions
|
@ -1,6 +1,6 @@
|
|||
import { SessionData } from '@roleypoly/types';
|
||||
import * as React from 'react';
|
||||
import { useApiContext } from '../api-context/ApiContext';
|
||||
import { useApiContext } from '../api/ApiContext';
|
||||
|
||||
type SessionContextT = {
|
||||
session?: Omit<Partial<SessionData>, 'tokens'>;
|
|
@ -1,8 +1,8 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { ApiContextProvider } from './api-context/ApiContext';
|
||||
import { AppRouter } from './app-router/AppRouter';
|
||||
import { SessionContextProvider } from './session-context/SessionContext';
|
||||
import { ApiContextProvider } from './contexts/api/ApiContext';
|
||||
import { SessionContextProvider } from './contexts/session/SessionContext';
|
||||
|
||||
ReactDOM.render(
|
||||
<React.StrictMode>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { AuthLogin } from '@roleypoly/design-system/templates/auth-login';
|
||||
import { GuildSlug } from '@roleypoly/types';
|
||||
import React from 'react';
|
||||
import { useApiContext } from '../../api-context/ApiContext';
|
||||
import { useApiContext } from '../../contexts/api/ApiContext';
|
||||
|
||||
const Login = () => {
|
||||
const { apiUrl, fetch } = useApiContext();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { useApiContext } from '../../api-context/ApiContext';
|
||||
import { useSessionContext } from '../../session-context/SessionContext';
|
||||
import { useApiContext } from '../../contexts/api/ApiContext';
|
||||
import { useSessionContext } from '../../contexts/session/SessionContext';
|
||||
|
||||
const SessionDebug = () => {
|
||||
const session = useSessionContext();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { navigate } from '@reach/router';
|
||||
import * as React from 'react';
|
||||
import { useApiContext } from '../../api-context/ApiContext';
|
||||
import { useApiContext } from '../../contexts/api/ApiContext';
|
||||
|
||||
const SetApi = () => {
|
||||
const apiContext = useApiContext();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Redirect } from '@reach/router';
|
||||
import { LandingTemplate } from '@roleypoly/design-system/templates/landing';
|
||||
import * as React from 'react';
|
||||
import { useSessionContext } from '../session-context/SessionContext';
|
||||
import { useSessionContext } from '../contexts/session/SessionContext';
|
||||
|
||||
const Landing = () => {
|
||||
const { isAuthenticated } = useSessionContext();
|
||||
|
|
|
@ -3,7 +3,7 @@ import { RolePickerTemplate } from '@roleypoly/design-system/templates/role-pick
|
|||
import { ServerSetupTemplate } from '@roleypoly/design-system/templates/server-setup';
|
||||
import { PresentableGuild, RoleUpdate, UserGuildPermissions } from '@roleypoly/types';
|
||||
import * as React from 'react';
|
||||
import { useSessionContext } from '../session-context/SessionContext';
|
||||
import { useSessionContext } from '../contexts/session/SessionContext';
|
||||
import { makeRoleTransactions } from '../utils/roleTransactions';
|
||||
|
||||
type PickerProps = {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Redirect } from '@reach/router';
|
||||
import { ServersTemplate } from '@roleypoly/design-system/templates/servers';
|
||||
import * as React from 'react';
|
||||
import { useSessionContext } from '../session-context/SessionContext';
|
||||
import { useSessionContext } from '../contexts/session/SessionContext';
|
||||
|
||||
const ServersPage = () => {
|
||||
const { isAuthenticated, session } = useSessionContext();
|
||||
|
|
Loading…
Add table
Reference in a new issue