Skip to content

Commit

Permalink
Merge pull request #115 from NiftyLeague/staging
Browse files Browse the repository at this point in the history
Smashers droptables info page
  • Loading branch information
NiftyAndy authored Nov 25, 2024
2 parents 46864b6 + a4ed40e commit dc2a275
Show file tree
Hide file tree
Showing 19 changed files with 15,782 additions and 5,163 deletions.
35 changes: 17 additions & 18 deletions apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,48 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"@axelar-network/axelarjs-sdk": "^0.16.2",
"@cowprotocol/cow-sdk": "^5.5.1",
"@hookform/resolvers": "^3.9.0",
"@mui/x-data-grid": "^7.18.0",
"@axelar-network/axelarjs-sdk": "^0.17.0",
"@cowprotocol/cow-sdk": "5.8.0-RC.5",
"@hookform/resolvers": "^3.9.1",
"@mui/x-data-grid": "^7.22.3",
"@nl/imx-passport": "workspace:^",
"@nl/theme": "workspace:^",
"@nl/ui": "workspace:^",
"@openzeppelin/contracts": "^5.0.2",
"@reduxjs/toolkit": "^2.2.7",
"@sentry/nextjs": "^8.32.0",
"@tabler/icons-react": "3.6.0",
"@tanstack/react-query": "^5.56.2",
"@web3modal/wagmi": "^5.1.10",
"@openzeppelin/contracts": "^5.1.0",
"@reduxjs/toolkit": "^2.3.0",
"@sentry/nextjs": "^8.40.0",
"@tabler/icons-react": "3.22.0",
"@tanstack/react-query": "^5.61.3",
"@web3modal/wagmi": "^5.1.11",
"axios": "^1.7.7",
"bnc-notify": "^1.9.8",
"bnc-sdk": "^4.6.9",
"date-fns": "^3.6.0",
"eth-rpc-errors": "^4.0.3",
"ethers": "^5.7.2",
"ethers6": "npm:ethers@^6.13.2",
"framer-motion": "^11.9.0",
"ethers6": "npm:ethers@^6.13.4",
"framer-motion": "^11.11.17",
"graphql": "^16.9.0",
"graphql-request": "^7.1.0",
"next": "^14.2.13",
"graphql-request": "^7.1.2",
"next": "^14.2.18",
"react-countdown": "^2.3.6",
"react-device-detect": "^2.2.3",
"react-draggable": "^4.4.6",
"react-ga4": "^2.1.0",
"react-hook-form": "^7.53.0",
"react-hook-form": "^7.53.2",
"react-intersection-observer": "^9.13.1",
"react-number-format": "^5.4.2",
"react-perfect-scrollbar": "^1.5.8",
"react-redux": "^9.1.2",
"react-slick": "^0.30.2",
"react-toastify": "^10.0.5",
"react-toastify": "^10.0.6",
"react-unity-webgl": "~8.8.0",
"redux": "^5.0.1",
"redux-persist": "^6.0.0",
"save-as": "^0.1.8",
"set-interval-async": "^3.0.3",
"slick-carousel": "^1.8.1",
"uuid": "^10.0.0",
"wagmi": "^2.12.16",
"wagmi": "^2.13.0",
"yup": "^1.4.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { format } from 'date-fns';
import type { Rentals, RentalType } from '@/types/rentals';
import { areEqualArrays } from '@/utils/array';
import { capitalize } from '@/utils/string';
import { v4 as uuidv4 } from 'uuid';
import useLocalStorage from '@/hooks/useLocalStorage';
import { RentalDataGrid } from '@/types/rentalDataGrid';
import { formatTime } from '@/utils/dateTime';

// eslint-disable-next-line import/prefer-default-export
export const transformRentals = (rows: Rentals[], userId: string, filterCategory?: RentalType): RentalDataGrid[] =>
Expand Down Expand Up @@ -116,7 +116,7 @@ export const transformRentals = (rows: Rentals[], userId: string, filterCategory
matches: matches || 0,
wins: wins || 0,
winRate: Number(wins) > 0 && Number(matches) > 0 ? (Number(wins) / Number(matches)) * 100 : 0,
timePlayed: time_played ? format(new Date(time_played), 'HH:mm:ss') : '00:00:00',
timePlayed: formatTime(time_played),
totalEarnings: earnings,
yourEarnings: yourEarnings || 0,
costs,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useMemo } from 'react';
import { Stack } from '@mui/material';
import { secondsToHours } from 'date-fns';

import { useGamerProfileContext } from '@/hooks/useGamerProfile';
import type { ProfileTotal, ProfileNiftySmsher } from '@/types/account';
import { formatNumberToDisplay } from '@/utils/numbers';
import { secondsToHours } from '@/utils/dateTime';

import Item from './Item';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useMemo } from 'react';
import { Stack } from '@mui/material';
import { secondsToHours } from 'date-fns';

import { useGamerProfileContext } from '@/hooks/useGamerProfile';
import type { ProfileMiniGame } from '@/types/account';
import { secondsToHours } from '@/utils/dateTime';
import Item from './Item';

interface MiniGameContentProps {
Expand Down
7 changes: 5 additions & 2 deletions apps/app/src/contexts/AppContextWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use server';

// third party
import { type PropsWithChildren } from 'react';
import { headers } from 'next/headers';
Expand All @@ -15,8 +17,9 @@ import { wagmiConfig } from '@/contexts/Web3ModalConfig';
import { Web3ModalProvider } from '@/contexts/Web3ModalContext';
import ReduxProvider from '@/store/ReduxProvider';

const AppContextWrapper = ({ children }: PropsWithChildren) => {
const initialState = cookieToInitialState(wagmiConfig, headers().get('cookie'));
const AppContextWrapper = async ({ children }: PropsWithChildren) => {
const headersList = await headers();
const initialState = cookieToInitialState(wagmiConfig, headersList.get('cookie'));
return (
<LocalStorageProvider>
<Web3ModalProvider initialState={initialState}>
Expand Down
15 changes: 15 additions & 0 deletions apps/app/src/utils/dateTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,19 @@ export function formatDateTime(timestamp: number | string): string {
return `${date.toLocaleDateString('en-US')} ${date.toLocaleTimeString('en-US', { timeStyle: 'short' })}`;
}

export function formatTime(time: number | string): string {
return time
? new Intl.DateTimeFormat('default', {
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
}).format(new Date(time))
: '00:00:00';
}

export function secondsToHours(seconds: number): number {
const hours = seconds / 3600;
return Math.trunc(hours);
}

export default formatDateTime;
20 changes: 10 additions & 10 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"@docusaurus/core": "3.5.2",
"@docusaurus/preset-classic": "3.5.2",
"@docusaurus/theme-mermaid": "^3.5.2",
"@heroicons/react": "^2.1.5",
"@mdx-js/react": "^3.0.1",
"@docusaurus/core": "3.6.3",
"@docusaurus/preset-classic": "3.6.3",
"@docusaurus/theme-mermaid": "^3.6.3",
"@heroicons/react": "^2.2.0",
"@mdx-js/react": "^3.1.0",
"@nl/ui": "workspace:^",
"algoliasearch": "^5.6.1",
"algoliasearch": "^5.15.0",
"prism-react-renderer": "^2.4.0",
"react-player": "^2.16.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.5.2",
"@docusaurus/theme-classic": "^3.5.2",
"@docusaurus/tsconfig": "3.5.2",
"@docusaurus/types": "3.5.2"
"@docusaurus/module-type-aliases": "3.6.3",
"@docusaurus/theme-classic": "^3.6.3",
"@docusaurus/tsconfig": "3.6.3",
"@docusaurus/types": "3.6.3"
}
}
16 changes: 8 additions & 8 deletions apps/smashers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"@metamask/eth-sig-util": "^7.0.3",
"@metamask/eth-sig-util": "^8.0.0",
"@nl/theme": "workspace:^",
"@nl/ui": "workspace:^",
"@sentry/nextjs": "^8.32.0",
"@sentry/nextjs": "^8.40.0",
"@vercel/edge": "^1.1.2",
"ethers6": "npm:ethers@^6.13.2",
"ethers6": "npm:ethers@^6.13.4",
"https": "^1.0.0",
"iron-session": "^6.3.1",
"jose": "^5.9.3",
"jose": "^5.9.6",
"lodash": "^4.17.21",
"next": "^14.2.13",
"next-auth": "^4.24.8",
"next": "^14.2.18",
"next-auth": "^4.24.10",
"notistack": "^3.0.1",
"playfab-sdk": "^2.162.240913",
"playfab-sdk": "^2.165.241108",
"react-device-detect": "^2.2.3",
"react-unity-webgl": "^9.5.2",
"react-unity-webgl": "^9.6.0",
"swr": "^2.2.5",
"url": "^0.11.4"
}
Expand Down
Loading

0 comments on commit dc2a275

Please sign in to comment.