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

add keystatic, upgrade account section and notifications, refactor to ark api #289

Merged
merged 171 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
171 commits
Select commit Hold shift + click to select a range
b88777c
token price update script
RedBeardEth Jul 11, 2024
63b829a
add image updating script
RedBeardEth Jul 12, 2024
44df430
package and imageupdate scrupt
RedBeardEth Jul 14, 2024
e237dee
add keystatic
RedBeardEth Jul 15, 2024
2100441
refactor layouts for keystatic
RedBeardEth Jul 16, 2024
0ee1a02
add more keystatic content and package upgrades
RedBeardEth Jul 29, 2024
9856b67
merge with main
4eyes52 Aug 25, 2024
b609f01
feat: add ark endpoints + collection list
MartianGreed Aug 27, 2024
0c27a47
feat: token details + activities + listing
MartianGreed Aug 28, 2024
90b1df2
fix: dynamic chain id
MartianGreed Aug 29, 2024
3894f30
feat: add price display
MartianGreed Aug 29, 2024
b9f9c11
feat: buy now
MartianGreed Aug 30, 2024
fb878ff
merge with main
4eyes52 Aug 30, 2024
9cdd166
move game page to keystatic content. modify some keystatic configs, f…
4eyes52 Aug 30, 2024
c59c97e
create Gamegrid component for consistency on homepage. update carouse…
4eyes52 Sep 2, 2024
00e2a3f
some more cleanup
4eyes52 Sep 2, 2024
dd24838
set up new card and grid components for blogs. set up new param page …
4eyes52 Sep 2, 2024
6cfc706
small cleanup. update top nav dropdown url for blogs
4eyes52 Sep 2, 2024
563324e
fix blog card url link. Fix publish date badge rendering
4eyes52 Sep 2, 2024
3b96919
move blog content to keystatic. set up image options for content fiel…
4eyes52 Sep 2, 2024
17a7a09
start to pull in updates from main
4eyes52 Sep 3, 2024
e89769c
cleaner merge with main
4eyes52 Sep 3, 2024
210f7a5
add all studio and game content to keystatic. Clean up game page logi…
4eyes52 Sep 3, 2024
15a1ede
fix event dates to use locale string. fix carousel on homepage to ren…
4eyes52 Sep 3, 2024
5bf3c32
fix styles for homepage. Dont need gamegrid component
4eyes52 Sep 3, 2024
74c6775
fix studio name rendering on game page
4eyes52 Sep 3, 2024
ce9fa11
add comment
4eyes52 Sep 3, 2024
26fa76c
update slugs for grugs lair and zkorp studios
4eyes52 Sep 3, 2024
3a99336
update screenshots for eternum
4eyes52 Sep 3, 2024
1a5ad8a
remove db scripts causing build error
RedBeardEth Sep 5, 2024
d818de1
fix AMMA page
RedBeardEth Sep 5, 2024
0ede200
fix build
RedBeardEth Sep 5, 2024
2eec8f3
remove this
4eyes52 Sep 6, 2024
3b4a4a5
Merge branch 'keystatic' of https://github.com/4eyes52/RealmsWorld in…
4eyes52 Sep 6, 2024
8b22fb6
merge with main
4eyes52 Sep 6, 2024
18f91c5
add staticParams function for each content type page so keystatic ren…
4eyes52 Sep 6, 2024
f847068
comment this out for now
4eyes52 Sep 6, 2024
ba53f57
change blogs to use slug instead of id
4eyes52 Sep 6, 2024
f06df4d
switch events games and studios to also use slug instead of id
4eyes52 Sep 6, 2024
88796ba
move content outside of src. update keystatic config path to not incl…
4eyes52 Sep 6, 2024
231a9df
see if this fixes
4eyes52 Sep 6, 2024
44a3019
add markdoc config to nextjs config just to see if that fixes rendering
4eyes52 Sep 6, 2024
666ae6e
comment this out to see if that is what fixes rendering
4eyes52 Sep 6, 2024
16c02b3
add this back
4eyes52 Sep 6, 2024
e257f0f
switch params.id to params.slug
4eyes52 Sep 6, 2024
91fa818
reset versions
4eyes52 Sep 7, 2024
d82ba16
Update content/events/test
4eyes52 Sep 7, 2024
a8d996f
Update content/events/tes3
4eyes52 Sep 7, 2024
a46b42b
Merge pull request #1 from 4eyes52/test1
4eyes52 Sep 7, 2024
12c4241
switch back to github for now
4eyes52 Sep 7, 2024
e75d068
Update content/events/testf
4eyes52 Sep 7, 2024
d8f36f8
Merge pull request #2 from 4eyes52/push-again
4eyes52 Sep 7, 2024
d387cba
set up pathPrefix
4eyes52 Sep 7, 2024
5b82572
Update content/events/test1
4eyes52 Sep 7, 2024
95a23a3
Merge pull request #3 from 4eyes52/create-these
4eyes52 Sep 7, 2024
d07f293
add back keystatic to api config
4eyes52 Sep 7, 2024
c105484
config tweaks
4eyes52 Sep 7, 2024
86db8dd
see what this does
4eyes52 Sep 7, 2024
2b99031
revert this
4eyes52 Sep 7, 2024
2164e2d
change configs around again
4eyes52 Sep 8, 2024
02702d7
one more config change
4eyes52 Sep 8, 2024
d458401
remove this
4eyes52 Sep 8, 2024
a2ffc10
remove static functions at bottom of pages
4eyes52 Sep 8, 2024
a9076b6
push up
4eyes52 Sep 8, 2024
adb9221
add env variables to env.ts
4eyes52 Sep 8, 2024
d1ac371
see if build works commenting this out
4eyes52 Sep 8, 2024
0e2df30
switch to env
4eyes52 Sep 8, 2024
5fce46b
switch to env
4eyes52 Sep 8, 2024
891f831
fix:
4eyes52 Sep 8, 2024
22f73c6
see if this builds
4eyes52 Sep 8, 2024
8f5bbf7
try this
4eyes52 Sep 8, 2024
5f47c69
test this
4eyes52 Sep 8, 2024
833dd76
some more adjustments
4eyes52 Sep 8, 2024
fa5994d
see whats in env during build
4eyes52 Sep 8, 2024
bd60419
bring back static page generation
4eyes52 Sep 8, 2024
a1cd1bb
push up some more tweaks
4eyes52 Sep 8, 2024
7e978ca
here we go
4eyes52 Sep 8, 2024
b6cd39c
Update content/events/test3
4eyes52 Sep 8, 2024
4c2b082
Merge pull request #4 from 4eyes52/testing-vercel-build
4eyes52 Sep 8, 2024
324fe35
set up new env variables for repository owner and name
4eyes52 Sep 8, 2024
fcb7da4
clean up new env variables
4eyes52 Sep 8, 2024
ac3e78f
change to process.env
4eyes52 Sep 8, 2024
784a43c
set up new env file outside of src
4eyes52 Sep 8, 2024
33d1893
switch back to hard coded repo
4eyes52 Sep 8, 2024
3fa4ed7
remove this
4eyes52 Sep 8, 2024
d0bdb5b
Update content/events/testttttiinnng
4eyes52 Sep 8, 2024
1a7898f
Delete content/events/testttttiinnng
4eyes52 Sep 8, 2024
c81abe8
Delete content/events/test3
4eyes52 Sep 8, 2024
c747cb4
Delete content/events/test1
4eyes52 Sep 8, 2024
f71974c
Delete content/events/test
4eyes52 Sep 8, 2024
1c81de1
Merge pull request #5 from 4eyes52/deleteevents
4eyes52 Sep 8, 2024
62a8e87
Update content/events/testfromotheraccount
kevk88 Sep 9, 2024
ce3c0ea
Update content/events/testest
kevk88 Sep 9, 2024
6b27469
Merge pull request #6 from 4eyes52/testaccount
kevk88 Sep 9, 2024
f7cce6c
fix generateMetaData to use slug
4eyes52 Sep 9, 2024
9106cf5
move env out of source so we can use env variables inside configs
4eyes52 Sep 11, 2024
8b99595
clean up
4eyes52 Sep 11, 2024
bd302c3
merge with main
4eyes52 Sep 11, 2024
de07ef4
update pnpm-lock
4eyes52 Sep 11, 2024
039e7c2
merge with main
4eyes52 Sep 14, 2024
120a712
Update content/blogs/the-lordship-protocol
4eyes52 Sep 14, 2024
76369cd
Update content/games/rising-revenant
4eyes52 Sep 14, 2024
ed25358
Merge pull request #8 from 4eyes52/lordship-protocol
4eyes52 Sep 14, 2024
60fdac4
Merge branch 'main' into keystatic
4eyes52 Sep 16, 2024
cb3358f
Update content/blogs/the-lordship-protocol
4eyes52 Sep 16, 2024
43f3efa
Merge pull request #9 from 4eyes52/lordship-blog
4eyes52 Sep 16, 2024
12634a1
remove markdoc lib for nextjs. clean up grid display for blog posts
4eyes52 Sep 17, 2024
37ff2c5
install zustand package
4eyes52 Sep 17, 2024
924b873
Merge pull request #270 from 4eyes52/keystatic
RedBeardEth Sep 18, 2024
e2dfa6d
Update content/events/testest
RedBeardEth Sep 18, 2024
fb7ebe3
Update content/games/realms-eternum
ponderingdemocritus Sep 18, 2024
cc37710
initial commit
4eyes52 Sep 18, 2024
e25c9c9
start to update localstorage
4eyes52 Sep 18, 2024
928f5d0
set up flag to prevent continuous queries when tx sheet is open
4eyes52 Sep 20, 2024
1b8bf03
clean up explorerlink text
4eyes52 Sep 20, 2024
fe6cf92
fix typescript and missing param in bridgenftwrapper, add transaction…
4eyes52 Sep 20, 2024
7d7a062
fix lint error for useEffect
4eyes52 Sep 20, 2024
30f685e
fix realms bridge subgraph
RedBeardEth Sep 22, 2024
4ccc762
package update
RedBeardEth Sep 22, 2024
bc5bcfe
print out sepolia env values so I have the right ones for localhost
4eyes52 Sep 22, 2024
4621104
clean up
4eyes52 Sep 22, 2024
9aae13d
only display transactioncount when starknet wallet connected
4eyes52 Sep 22, 2024
2ae5675
fix typescript error
4eyes52 Sep 22, 2024
f9c81ed
see logs in vercel
4eyes52 Sep 22, 2024
47074b6
remove status check for FINISHED in usePendingRealmsWithdrawals
4eyes52 Sep 22, 2024
766ba89
update localstorage with finishedwithdrawal events
4eyes52 Sep 22, 2024
5c38cbc
updates
4eyes52 Sep 22, 2024
c628cb2
clean up comments, logs
4eyes52 Sep 22, 2024
e17ab7c
toggle between QueryTransactionList or LocalStorageList component in …
4eyes52 Sep 23, 2024
4f73fb8
simplify ustransactionmanager, fire rpc queries once in useTransactio…
4eyes52 Sep 25, 2024
bd34137
remove comments
4eyes52 Sep 25, 2024
fdb7f54
import cleanup, provide some context for logic
4eyes52 Sep 25, 2024
8868949
some more cleanup
4eyes52 Sep 25, 2024
4ad9f84
check if local storage combinedtransactions is empty
4eyes52 Sep 25, 2024
dbfd3a4
fix logic for initial wallet open
4eyes52 Sep 25, 2024
9c751a7
better comments for logic
4eyes52 Sep 25, 2024
e6ee3c3
Update LegacyClaim.tsx
RedBeardEth Sep 25, 2024
690eac2
add frontinus, tanstack start
RedBeardEth Sep 27, 2024
1694f82
remove about
RedBeardEth Sep 27, 2024
22bf4f7
add missing build package
RedBeardEth Sep 27, 2024
13cadf4
add lucide react
RedBeardEth Sep 27, 2024
be46dd8
update nextjs components to new format
RedBeardEth Sep 27, 2024
aee453b
add realmsworld utils
RedBeardEth Sep 27, 2024
785ffd6
Merge remote-tracking branch 'origin/frontinus-poc' into frontinus-poc
RedBeardEth Sep 27, 2024
a1db5aa
update lockfile
RedBeardEth Sep 27, 2024
36763d6
add constants
RedBeardEth Sep 27, 2024
0314af5
move starknet provider
RedBeardEth Sep 27, 2024
713a1b6
update next components
RedBeardEth Sep 27, 2024
9aada3c
Merge branch 'main' into upgrade-tx-notifications
4eyes52 Sep 27, 2024
770f844
remove starknet
RedBeardEth Sep 30, 2024
7079a5d
try add types as dep
RedBeardEth Sep 30, 2024
69cac0d
Revert "try add types as dep"
RedBeardEth Sep 30, 2024
c348106
remove starknet
RedBeardEth Sep 30, 2024
b86cd5d
Merge branch 'main' into frontinus-poc
RedBeardEth Sep 30, 2024
8dad218
update server preset and packges
RedBeardEth Sep 30, 2024
356ab5f
fix styles
RedBeardEth Sep 30, 2024
125c72c
actually fix styles
RedBeardEth Sep 30, 2024
d2c7bbc
test starknet
RedBeardEth Sep 30, 2024
4550e08
test
RedBeardEth Sep 30, 2024
02d5667
merge ark
RedBeardEth Oct 1, 2024
de7e799
init portfolio account changes to ark api
RedBeardEth Oct 1, 2024
c4231f3
Merge branch 'frontinus-poc'
RedBeardEth Oct 2, 2024
45d48cb
account made into dashboard, improve perf
RedBeardEth Oct 5, 2024
0026d2f
fix individual token display
RedBeardEth Oct 5, 2024
09c2f63
fix velords chart
RedBeardEth Oct 5, 2024
1a5b019
fic velords chart
RedBeardEth Oct 6, 2024
b935417
Merge remote-tracking branch 'origin/upgrade-tx-notifications'
RedBeardEth Oct 6, 2024
406737c
various cleanup and merge fixes
RedBeardEth Oct 6, 2024
694255b
fix margins and bridge l2
RedBeardEth Oct 7, 2024
85bb50e
various responsive fixes
RedBeardEth Oct 7, 2024
5c6b9a3
fix homepage carousel, sidebar z-index and responsive
RedBeardEth Oct 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .env.mainnet
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ NEXT_PUBLIC_STARKSCAN_URL=https://starkscan.co
NEXT_PUBLIC_SUBGRAPH_NAME=https://api.thegraph.com/subgraphs/name/redbeardeth/starknet-bridge-mainnet
NEXT_PUBLIC_APIBARA_HANDLE=graphql
NEXT_PUBLIC_REALMS_SUBGRAPH_NAME=https://api.thegraph.com/subgraphs/name/bibliothecaforadventurers/realms
NEXT_PUBLIC_REALMS_BRIDGE_SUBGRAPH_NAME=https://api.studio.thegraph.com/query/73174/realms-bridge-main/version/latest
NEXT_PUBLIC_REALMS_LEGACY_REWARD_SUBGRAPH_NAME=https://api.studio.thegraph.com/query/73174/legacy-rewards-sepolia/version/latest


# @see https://next-auth.js.org/configuration/options#nextauth_url
AUTH_URL='http://localhost:3000'
Expand Down
1 change: 1 addition & 0 deletions .env.sepolia
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ NEXT_PUBLIC_STARKSCAN_URL=https://testnet.starkscan.co
NEXT_PUBLIC_SUBGRAPH_NAME=redbeardeth/starknet-bridge-goerli
NEXT_PUBLIC_APIBARA_HANDLE=goerli-graphql
NEXT_PUBLIC_REALMS_SUBGRAPH_NAME=bibliothecadao/goerli-realms
NEXT_PUBLIC_REALMS_BRIDGE_SUBGRAPH_NAME=https://api.studio.thegraph.com/query/73174/realms-bridge/version/latest
NEXT_PUBLIC_REALMS_LEGACY_REWARD_SUBGRAPH_NAME=https://api.studio.thegraph.com/query/73174/legacy-rewards-sepolia/version/latest


Expand Down
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@
"deno.enable": false,
"deno.lint": false,
"deno.unstable": false,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
// Sometimes vscode prettier doesn't format .tsx file without this config.
// see also: https://stackoverflow.com/questions/61731587/vscode-prettier-doesnt-format-tsx-file
"editor.defaultFormatter": "esbenp.prettier-vscode"
}

/*"deno.enable": true,
Expand Down
2 changes: 1 addition & 1 deletion apps/frontinus-house/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@types/remarkable": "^2.0.8",
"autoprefixer": "^10.4.19",
"graphql": "^16.9.0",
"highlight.js": "^11.9.0",
"highlight.js": "^11.10.0",
"highlightjs-solidity": "^2.0.6",
"postcss": "^8.4.41",
"react": "catalog:react18",
Expand Down
12 changes: 8 additions & 4 deletions apps/frontinus-house/src/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,29 @@ import {
} from "lucide-react";
import { Link } from "react-router-dom";

import { Badge } from "@realms-world/ui/components/ui/badge";
import { Button } from "@realms-world/ui/components/ui/button";
import {
Badge,
Button,
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@realms-world/ui/components/ui/card";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
Input,
} from "@realms-world/ui/components/ui/dropdown-menu";
import { Input } from "@realms-world/ui/components/ui/input";
import {
Sheet,
SheetContent,
SheetTrigger,
} from "@realms-world/ui";
} from "@realms-world/ui/components/ui/sheet";

export default function Header() {
return (
Expand Down
5 changes: 3 additions & 2 deletions apps/frontinus-house/src/components/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import { sidelinks } from "@/data/menuLinks";
import { Bell, Package2 } from "lucide-react";
import { Link } from "react-router-dom";

import { Button } from "@realms-world/ui/components/ui/button";
import {
Button,
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@realms-world/ui";
} from "@realms-world/ui/components/ui/card";


interface SidebarProps extends React.HTMLAttributes<HTMLElement> {
isCollapsed: boolean;
Expand Down
44 changes: 21 additions & 23 deletions apps/frontinus-house/src/lib/network/index.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
import { createStarknetNetwork } from './starknet';
import { createEvmNetwork } from './evm';
import { NetworkID } from '@/types';
import { ReadWriteNetwork } from './types';
import { createStarknetNetwork } from "./starknet";
import { createEvmNetwork } from "./evm";
import { NetworkID } from "@/types";
import { ReadWriteNetwork } from "./types";

const starknetNetwork = createStarknetNetwork("sn");
const starknetSepoliaNetwork = createStarknetNetwork("sn-sep");
const ethereumNetwork = createEvmNetwork("eth");
const sepoliaNetwork = createEvmNetwork("sep");

const starknetNetwork = createStarknetNetwork('sn');
const starknetSepoliaNetwork = createStarknetNetwork('sn-sep');
const ethereumNetwork = createEvmNetwork('eth');
const sepoliaNetwork = createEvmNetwork('sep');
export const enabledNetworks: NetworkID[] = import.meta.env
.VITE_ENABLED_NETWORKS
? (import.meta.env.VITE_ENABLED_NETWORKS.split(",") as NetworkID[])
: ["sn", "sn-sep"];

export const enabledNetworks: NetworkID[] = import.meta.env.VITE_ENABLED_NETWORKS
? (import.meta.env.VITE_ENABLED_NETWORKS.split(',') as NetworkID[])
: ['eth', 'sep', 'sn', 'sn-sep'];

export const evmNetworks: NetworkID[] = [
'eth',
'sep',
];
export const evmNetworks: NetworkID[] = ["eth", "sep"];

export const getNetwork = (id: NetworkID) => {
if (!enabledNetworks.includes(id)) throw new Error(`Network ${id} is not enabled`);
if (!enabledNetworks.includes(id))
throw new Error(`Network ${id} is not enabled`);

if (id === 'eth') return ethereumNetwork;
if (id === 'sep') return sepoliaNetwork;
if (id === 'sn') return starknetNetwork;
if (id === 'sn-sep') return starknetSepoliaNetwork;
if (id === "eth") return ethereumNetwork;
if (id === "sep") return sepoliaNetwork;
if (id === "sn") return starknetNetwork;
if (id === "sn-sep") return starknetSepoliaNetwork;

throw new Error(`Unknown network ${id}`);
};
Expand All @@ -37,7 +35,7 @@ export const getReadWriteNetwork = (id: NetworkID): ReadWriteNetwork => {
};

export const enabledReadWriteNetworks: NetworkID[] = enabledNetworks.filter(
id => !getNetwork(id).readOnly
(id) => !getNetwork(id).readOnly,
);

/**
Expand All @@ -47,4 +45,4 @@ export const enabledReadWriteNetworks: NetworkID[] = enabledNetworks.filter(
*/
export const supportsNullCurrent = (networkID: NetworkID) => {
return !evmNetworks.includes(networkID);
};
};
5 changes: 2 additions & 3 deletions apps/frontinus-house/src/pages/proposals/[id]/overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ import { Markdown } from "@/components/Markdown";
import { _rt, getProposalId, shortenAddress } from "@/lib/utils";
import { Proposal } from "@/types";
import { Link, useLocation } from "react-router-dom";
import { Button } from "@realms-world/ui/components/ui/button";

import {
Button,
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
Tooltip,
} from "@realms-world/ui";
} from "@realms-world/ui/components/ui/dropdown-menu";

export default function Overview({ proposal }: { proposal: Proposal }) {
let location = useLocation();
Expand Down
18 changes: 18 additions & 0 deletions apps/frontinus/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Local
.DS_Store
*.local
*.log*

# Dist
node_modules
dist/
.vinxi
.output
.vercel
.netlify
.wrangler

# IDE
.vscode/*
!.vscode/extensions.json
.idea
16 changes: 16 additions & 0 deletions apps/frontinus/app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { defineConfig } from "@tanstack/start/config";
import tsConfigPaths from "vite-tsconfig-paths";

// https://vitejs.dev/config/
export default defineConfig({
vite: {
plugins: () => [
tsConfigPaths({
projects: ["./tsconfig.json"],
}),
],
},
server: {
preset: "vercel",
},
});
4 changes: 4 additions & 0 deletions apps/frontinus/app/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
:root {
--font-bebas-neue: "Bebas Neue";
--font-space-mono: "Space Mono";
}
7 changes: 7 additions & 0 deletions apps/frontinus/app/client.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/start'
import { createRouter } from './router'

const router = createRouter()

hydrateRoot(document.getElementById('root')!, <StartClient router={router} />)
17 changes: 17 additions & 0 deletions apps/frontinus/app/components/icons/starknet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions apps/frontinus/app/components/layout/DefaultCatchBoundary.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import {
ErrorComponent,
ErrorComponentProps,
Link,
rootRouteId,
useMatch,
useRouter,
} from '@tanstack/react-router'

export function DefaultCatchBoundary({ error }: ErrorComponentProps) {
const router = useRouter()
const isRoot = useMatch({
strict: false,
select: (state) => state.id === rootRouteId,
})

console.error(error)

return (
<div className="min-w-0 flex-1 p-4 flex flex-col items-center justify-center gap-6">
<ErrorComponent error={error} />
<div className="flex gap-2 items-center flex-wrap">
<button
onClick={() => {
router.invalidate()
}}
className={`px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded text-white uppercase font-extrabold`}
>
Try Again
</button>
{isRoot ? (
<Link
to="/"
className={`px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded text-white uppercase font-extrabold`}
>
Home
</Link>
) : (
<Link
to="/"
className={`px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded text-white uppercase font-extrabold`}
onClick={(e) => {
e.preventDefault()
window.history.back()
}}
>
Go Back
</Link>
)}
</div>
</div>
)
}
25 changes: 25 additions & 0 deletions apps/frontinus/app/components/layout/NotFound.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Link } from '@tanstack/react-router'

export function NotFound({ children }: { children?: any }) {
return (
<div className="space-y-2 p-2">
<div className="text-gray-600 dark:text-gray-400">
{children || <p>The page you are looking for does not exist.</p>}
</div>
<p className="flex items-center gap-2 flex-wrap">
<button
onClick={() => window.history.back()}
className="bg-emerald-500 text-white px-2 py-1 rounded uppercase font-black text-sm"
>
Go back
</button>
<Link
to="/"
className="bg-cyan-600 text-white px-2 py-1 rounded uppercase font-black text-sm"
>
Start Over
</Link>
</p>
</div>
)
}
37 changes: 37 additions & 0 deletions apps/frontinus/app/components/layout/mode-toggle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { Moon, Sun } from "lucide-react"

import { Button } from "@realms-world/ui/components/ui/button"
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "@realms-world/ui/components/ui/dropdown-menu"
import { useTheme } from "app/components/layout/theme-provider"

export function ModeToggle() {
const { setTheme } = useTheme()

return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="outline" size="icon">
<Sun className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
<Moon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
<span className="sr-only">Toggle theme</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem onClick={() => setTheme("light")}>
Light
</DropdownMenuItem>
<DropdownMenuItem onClick={() => setTheme("dark")}>
Dark
</DropdownMenuItem>
<DropdownMenuItem onClick={() => setTheme("system")}>
System
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
)
}
Loading
Loading