Improvements
This commit is contained in:
5 files changed
+33
-29
No files matched your search
@@ -16,7 +16,7 @@
|
|||||||
"url": "/update/checking",
|
"url": "/update/checking",
|
||||||
"width": 1000,
|
"width": 1000,
|
||||||
"height": 600,
|
"height": 600,
|
||||||
"minWidth": 875,
|
"minWidth": 900,
|
||||||
"minHeight": 500
|
"minHeight": 500
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
"url": "/update/checking",
|
"url": "/update/checking",
|
||||||
"width": 1000,
|
"width": 1000,
|
||||||
"height": 600,
|
"height": 600,
|
||||||
"minWidth": 875,
|
"minWidth": 900,
|
||||||
"minHeight": 500,
|
"minHeight": 500,
|
||||||
"titleBarStyle": "Overlay",
|
"titleBarStyle": "Overlay",
|
||||||
"hiddenTitle": true
|
"hiddenTitle": true
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
"url": "/update/checking",
|
"url": "/update/checking",
|
||||||
"width": 1000,
|
"width": 1000,
|
||||||
"height": 632,
|
"height": 632,
|
||||||
"minWidth": 875,
|
"minWidth": 900,
|
||||||
"minHeight": 532,
|
"minHeight": 532,
|
||||||
"decorations": false,
|
"decorations": false,
|
||||||
"shadow": true
|
"shadow": true
|
||||||
|
|||||||
@@ -85,10 +85,12 @@ export default function BerryDashLeaderboards () {
|
|||||||
const [selected, setSelected] = useState<number>(-1)
|
const [selected, setSelected] = useState<number>(-1)
|
||||||
const [selectedBerryOption, setSelectedBerryOption] = useState<number>(0)
|
const [selectedBerryOption, setSelectedBerryOption] = useState<number>(0)
|
||||||
const [entries, setEntries] = useState<(LeaderboardEntry | Account)[]>([])
|
const [entries, setEntries] = useState<(LeaderboardEntry | Account)[]>([])
|
||||||
|
const [loading, setLoading] = useState<boolean>(false)
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
const Refresh = useCallback(async () => {
|
const Refresh = useCallback(async () => {
|
||||||
|
setLoading(true)
|
||||||
try {
|
try {
|
||||||
if (selected == 3 || selected == 4) {
|
if (selected == 3 || selected == 4) {
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
@@ -145,6 +147,7 @@ export default function BerryDashLeaderboards () {
|
|||||||
} catch {
|
} catch {
|
||||||
setEntries([])
|
setEntries([])
|
||||||
}
|
}
|
||||||
|
setLoading(false)
|
||||||
}, [selected, selectedBerryOption])
|
}, [selected, selectedBerryOption])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -160,6 +163,25 @@ export default function BerryDashLeaderboards () {
|
|||||||
<div className='flex justify-between items-center mb-4'>
|
<div className='flex justify-between items-center mb-4'>
|
||||||
<p className='text-3xl'>Berry Dash Leaderboards</p>
|
<p className='text-3xl'>Berry Dash Leaderboards</p>
|
||||||
<div className='flex gap-2'>
|
<div className='flex gap-2'>
|
||||||
|
{selected == 1 && (
|
||||||
|
<div className='flex justify-center'>
|
||||||
|
<select
|
||||||
|
className='bg-(--col2) border border-(--col4) rounded-md'
|
||||||
|
value={selectedBerryOption}
|
||||||
|
onChange={e => setSelectedBerryOption(Number(e.target.value))}
|
||||||
|
>
|
||||||
|
<option value='0'>Normal Berry</option>
|
||||||
|
<option value='1'>Poison Berry</option>
|
||||||
|
<option value='2'>Slow Berry</option>
|
||||||
|
<option value='3'>Ultra Berry</option>
|
||||||
|
<option value='4'>Speedy Berry</option>
|
||||||
|
<option value='5'>Coin Berry</option>
|
||||||
|
<option value='6'>Random Berry</option>
|
||||||
|
<option value='7'>Anti Berry</option>
|
||||||
|
<option value='8'>Golden Berry</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<button
|
<button
|
||||||
className='button btntheme1'
|
className='button btntheme1'
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -242,15 +264,15 @@ export default function BerryDashLeaderboards () {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
) : loading ? (
|
||||||
|
<p className='flex justify-center items-center text-6xl h-full'>
|
||||||
|
Loading
|
||||||
|
</p>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
className={`flex flex-col gap-2 overflow-y-auto ${
|
className={`flex flex-col gap-2 overflow-y-auto ${
|
||||||
selected == 1
|
platform() == 'windows'
|
||||||
? platform() == 'windows'
|
|
||||||
? 'h-[calc(100vh-156px)]'
|
|
||||||
: 'h-[calc(100vh-124px)]'
|
|
||||||
: platform() == 'windows'
|
|
||||||
? 'h-[calc(100vh-128px)]'
|
? 'h-[calc(100vh-128px)]'
|
||||||
: 'h-[calc(100vh-96px)]'
|
: 'h-[calc(100vh-96px)]'
|
||||||
} px-1`}
|
} px-1`}
|
||||||
@@ -312,25 +334,6 @@ export default function BerryDashLeaderboards () {
|
|||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
{selected == 1 && (
|
|
||||||
<div className='flex justify-center'>
|
|
||||||
<select
|
|
||||||
className='mt-1.25 bg-(--col2) border border-(--col4) rounded-md'
|
|
||||||
value={selectedBerryOption}
|
|
||||||
onChange={e => setSelectedBerryOption(Number(e.target.value))}
|
|
||||||
>
|
|
||||||
<option value='0'>Normal Berry</option>
|
|
||||||
<option value='1'>Poison Berry</option>
|
|
||||||
<option value='2'>Slow Berry</option>
|
|
||||||
<option value='3'>Ultra Berry</option>
|
|
||||||
<option value='4'>Speedy Berry</option>
|
|
||||||
<option value='5'>Coin Berry</option>
|
|
||||||
<option value='6'>Random Berry</option>
|
|
||||||
<option value='7'>Anti Berry</option>
|
|
||||||
<option value='8'>Golden Berry</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -59,10 +59,11 @@ export default function Sidebar () {
|
|||||||
}}
|
}}
|
||||||
></div>
|
></div>
|
||||||
<div
|
<div
|
||||||
className={`flex items-center h-10 w-60 ${
|
className={
|
||||||
|
'flex items-center h-10 w-60 ' +
|
||||||
(platform() == 'windows' ? 'pl-1 pt-1' : 'pl-2 pt-2') +
|
(platform() == 'windows' ? 'pl-1 pt-1' : 'pl-2 pt-2') +
|
||||||
(platform() == 'macos' ? ' mt-7' : '')
|
(platform() == 'macos' ? ' mt-7' : '')
|
||||||
}`}
|
}
|
||||||
onMouseDown={e => {
|
onMouseDown={e => {
|
||||||
if (platform() != 'macos') return
|
if (platform() != 'macos') return
|
||||||
if (e.buttons === 1) {
|
if (e.buttons === 1) {
|
||||||
|
|||||||
Reference in new issue
Block a user