Skip to content

Commit

Permalink
Cleanup Settings (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
avgupta456 authored Nov 29, 2023
1 parent 6d2a602 commit fbfb12e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
4 changes: 1 addition & 3 deletions frontend/src/pages/App/AppTrends.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ function App() {
element={<WrappedRedirectScreen />}
/>
<Route path="/wrapped" element={<WrappedRedirectScreen />} />
{isAuthenticated && (
<Route path="/settings" element={<SettingsScreen />} />
)}
<Route path="/settings" element={<SettingsScreen />} />
<Route path="/:userId" element={<WrappedRedirectScreen />} />
<Route exact path="/" element={<LandingScreen />} />
<Route path="*" element={<NoMatchScreen />} />
Expand Down
16 changes: 6 additions & 10 deletions frontend/src/pages/Auth/SignUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,25 @@ const SignUpScreen = () => {
<div
className={classnames(
'bg-gray-100 rounded-sm w-full h-full m-auto p-8 shadow',
'lg:w-96 lg:h-auto 2xl:w-1/2 2xl:h-1/2 2xl:flex 2xl:flex-col 2xl:justify-between',
'lg:w-80 lg:h-auto',
)}
>
<h3 className="text-3xl 2xl:text-4xl font-semibold text-gray-900 mb-12 text-center">
<h3 className="text-3xl font-semibold text-gray-900 mb-12 text-center">
Sign up for <br />
GitHub Trends
</h3>
<div>
<a href={GITHUB_PUBLIC_AUTH_URL} className="flex justify-center">
<Button className="h-12 flex justify-center items-center text-white bg-blue-500 hover:bg-blue-600">
<GithubIcon className="w-4 h-4 2xl:w-6 2xl:h-6" />
<span className="ml-2 xl:text-lg 2xl:text-xl">
GitHub Public Access
</span>
<GithubIcon className="w-4 h-4" />
<span className="ml-2 xl:text-lg">GitHub Public Access</span>
</Button>
</a>
<div className="mt-4" />
<a href={GITHUB_PRIVATE_AUTH_URL} className="flex justify-center">
<Button className="h-12 flex justify-center items-center text-black border border-black bg-white hover:bg-gray-100">
<GithubIcon className="w-4 h-4 2xl:w-6 2xl:h-6" />
<span className="ml-2 xl:text-lg 2xl:text-xl">
GitHub Private Access
</span>
<GithubIcon className="w-4 h-4" />
<span className="ml-2 xl:text-lg">GitHub Private Access</span>
</Button>
</a>
</div>
Expand Down
15 changes: 15 additions & 0 deletions frontend/src/pages/Settings/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,28 @@ const SettingsScreen = () => {
useOutsideAlerter(wrapperRef, closeDeleteModal);

const userId = useSelector((state) => state.user.userId);
const isAuthenticated = userId && userId.length > 0;
const userKey = useSelector((state) => state.user.userKey);
const privateAccess = useSelector((state) => state.user.privateAccess);
const accountTier = privateAccess ? 'Private Workflow' : 'Public Workflow';

const dispatch = useDispatch();
const logout = () => dispatch(_logout());

console.log(isAuthenticated, userId, userKey, privateAccess, accountTier);

if (!isAuthenticated) {
return (
<div className="h-full py-8 flex justify-center items-center">
<div className="text-center">
<h1 className="text-3xl font-bold">
Please sign in to access this page
</h1>
</div>
</div>
);
}

return (
<div className="h-full w-full">
<div className={classnames('h-full flex', deleteModal && 'opacity-25')}>
Expand Down

1 comment on commit fbfb12e

@vercel
Copy link

@vercel vercel bot commented on fbfb12e Nov 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.