Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup Settings #255

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading