Skip to content

Commit 15ebad8

Browse files
committed
refactor: modernize repo
1 parent 28b0dee commit 15ebad8

31 files changed

Lines changed: 6241 additions & 5566 deletions

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,12 @@ typings/
5858
.env
5959

6060
dist
61+
62+
# Yarn 3
63+
.pnp.*
64+
.yarn/*
65+
!.yarn/patches
66+
!.yarn/plugins
67+
!.yarn/releases
68+
!.yarn/sdks
69+
!.yarn/versions

.swcrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"jsc": {
3+
"parser": {
4+
"syntax": "typescript",
5+
"tsx": true
6+
}
7+
}
8+
}

.yarn/releases/yarn-4.9.2.cjs

Lines changed: 942 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
yarnPath: .yarn/releases/yarn-4.9.2.cjs
2+
3+
nodeLinker: node-modules

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@
55
### Run
66

77
`yarn install && yarn start`
8-
9-
Opens `http://localhost:8888`

app/components/Access.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import type { ComponentPropsWithoutRef } from 'react';
2+
import { AccessContext } from '@poool/react-access';
3+
4+
import { useAuth } from '../hooks';
5+
6+
const Access = ({ children }: ComponentPropsWithoutRef<any>) => {
7+
const { consentGiven } = useAuth();
8+
9+
return (
10+
<AccessContext
11+
appId="155PF-L7Q6Q-EB2GG-04TF8"
12+
config={{
13+
debug: true,
14+
cookies_enabled: consentGiven,
15+
custom_segment: 'react',
16+
}}
17+
withAudit={true}
18+
>
19+
{ children }
20+
</AccessContext>
21+
);
22+
};
23+
24+
export default Access;
Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,27 @@
1-
import { useEffect } from 'react';
21
import { BrowserRouter, Route, Routes } from 'react-router-dom';
3-
import { AccessContext } from '@poool/react-access';
42

5-
import { defaultHistory } from '../utils';
63
import Home from './Home';
74
import Premium from './Premium';
85
import Free from './Free';
96
import Subscription from './Subscription';
107
import Auth from './Auth';
8+
import Access from './Access';
119

12-
export default () => {
13-
useEffect(() => {
14-
return defaultHistory.listen(() => window.scrollTo(0, 0));
15-
}, []);
16-
10+
const App = () => {
1711
return (
18-
<BrowserRouter history={defaultHistory}>
12+
<BrowserRouter>
1913
<Auth>
20-
<AccessContext
21-
appId="155PF-L7Q6Q-EB2GG-04TF8"
22-
config={{
23-
debug: true,
24-
cookies_enabled: true,
25-
custom_segment: 'react',
26-
}}
27-
withAudit={true}
28-
>
14+
<Access>
2915
<Routes>
3016
<Route path="/premium" element={<Premium />} />
3117
<Route path="/free" element={<Free />} />
3218
<Route path="/subscribe" element={<Subscription />} />
3319
<Route index element={<Home />} />
3420
</Routes>
35-
</AccessContext>
21+
</Access>
3622
</Auth>
3723
</BrowserRouter>
3824
);
3925
};
26+
27+
export default App;

app/components/Auth.js

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)