Skip to content

Commit

Permalink
Redesign the entire fucking thing with PicoCSS
Browse files Browse the repository at this point in the history
  • Loading branch information
NotNite committed Nov 27, 2023
1 parent bf50afe commit cb99b78
Show file tree
Hide file tree
Showing 18 changed files with 615 additions and 191 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ dist-ssr
*.njsproj
*.sln
*.sw?

.env.local
.env.production
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</head>

<body>
<div id="root"></div>
<main class="container" id="root"></main>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
142 changes: 133 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
"preview": "vite preview"
},
"dependencies": {
"@picocss/pico": "^1.5.10",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.18.0"
"react-feather": "^2.0.10",
"react-router-dom": "^6.18.0",
"zustand": "^4.4.6"
},
"devDependencies": {
"@types/react": "^18.2.15",
Expand Down
4 changes: 0 additions & 4 deletions src/App.css

This file was deleted.

51 changes: 18 additions & 33 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,39 +1,24 @@
import "./App.css";

function genState() {
const alphabet =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
let state = "";
for (let i = 0; i < 32; i++) {
state += alphabet[Math.floor(Math.random() * alphabet.length)];
}
return state;
}
export default function App() {
const state = genState();
localStorage.setItem("state", state);

const redirectUri = new URL("https://discord.com/api/oauth2/authorize");
const query = new URLSearchParams({
client_id: import.meta.env.VITE_DISCORD_CLIENT_ID,
redirect_uri: import.meta.env.VITE_DISCORD_REDIRECT_URI,
response_type: "code",
scope: "identify",
state
});
redirectUri.search = query.toString();
import { Link, Outlet } from "react-router-dom";
import CurrentAccount from "./components/CurrentAccount";

export default function Root() {
return (
<>
<h1>SlopNet</h1>
<p>
This website will let you connect your Discord account to Slop Crew.
While this is a currently unused feature, it will be used in the future.
</p>
<p>Click the button below to sign in:</p>
<a href={redirectUri.toString()}>
<button>Sign in with Discord</button>
</a>
<nav>
<ul>
<li>
<Link to="/" className="contrast">
<strong>SlopNet</strong>
</Link>
</li>
</ul>

<ul>
<CurrentAccount />
</ul>
</nav>

<Outlet />
</>
);
}
Loading

0 comments on commit cb99b78

Please sign in to comment.