forked from Berry-Dash/launcher
Look at description for changelog
- Wine support - Loading script - Format code - Hide downloads button on sidebar when not downloading - Add installs list - A lot of improvements & more
This commit is contained in:
@@ -2,14 +2,24 @@ import './Sidebar.css'
|
||||
import Icon from '../Icon.png'
|
||||
import { openUrl } from '@tauri-apps/plugin-opener'
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||
import { faCog, faDownload, faRankingStar, faServer } from '@fortawesome/free-solid-svg-icons'
|
||||
import {
|
||||
faCog,
|
||||
faDownload,
|
||||
faRankingStar,
|
||||
faServer
|
||||
} from '@fortawesome/free-solid-svg-icons'
|
||||
import { faDiscord } from '@fortawesome/free-brands-svg-icons'
|
||||
import { useState } from 'react'
|
||||
import { platform } from '@tauri-apps/plugin-os'
|
||||
import { getCurrentWindow } from '@tauri-apps/api/window'
|
||||
import { SidebarProps } from '../types/SidebarProps'
|
||||
|
||||
export default function Sidebar({ setShowPopup, setPopupMode, setFadeOut }: SidebarProps) {
|
||||
export default function Sidebar ({
|
||||
setShowPopup,
|
||||
setPopupMode,
|
||||
setFadeOut,
|
||||
downloadProgress
|
||||
}: SidebarProps) {
|
||||
const [rot, setRot] = useState(0)
|
||||
const [dir, setDir] = useState(1)
|
||||
|
||||
@@ -41,7 +51,9 @@ export default function Sidebar({ setShowPopup, setPopupMode, setFadeOut }: Side
|
||||
style={{
|
||||
transform: `rotate(${rot}deg)`,
|
||||
transition: 'transform 0.3s ease',
|
||||
marginTop: ['windows','macos'].includes(platform()) ? '20px' : '0px'
|
||||
marginTop: ['windows', 'macos'].includes(platform())
|
||||
? '20px'
|
||||
: '0px'
|
||||
}}
|
||||
onClick={() =>
|
||||
setRot(r => {
|
||||
@@ -71,14 +83,60 @@ export default function Sidebar({ setShowPopup, setPopupMode, setFadeOut }: Side
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<nav className="nav-links">
|
||||
<a draggable={false} href="#installs" className={`link ${(window.location.hash || '#installs') === '#installs' ? 'active' : ''}`}><FontAwesomeIcon icon={faServer} className="mr-1" /> Installs</a>
|
||||
<a draggable={false} href="#settings" className={`link ${(window.location.hash || '#installs') === '#settings' ? 'active' : ''}`}><FontAwesomeIcon icon={faCog} className="mr-1" /> Settings</a>
|
||||
<a draggable={false} href="#leaderboards" className={`link ${(window.location.hash || '#installs') === '#leaderboards' ? 'active' : ''}`}><FontAwesomeIcon icon={faRankingStar} className="mr-1" /> Leaderboards</a>
|
||||
<a draggable={false} onClick={() => openUrl("https://berrydash.lncvrt.xyz/discord")} className="link"><FontAwesomeIcon icon={faDiscord} className="mr-1" /> Community</a>
|
||||
<nav className='nav-links'>
|
||||
<a
|
||||
draggable={false}
|
||||
href='#installs'
|
||||
className={`link ${
|
||||
(window.location.hash || '#installs') === '#installs'
|
||||
? 'active'
|
||||
: ''
|
||||
}`}
|
||||
>
|
||||
<FontAwesomeIcon icon={faServer} className='mr-1' /> Installs
|
||||
</a>
|
||||
<a
|
||||
draggable={false}
|
||||
href='#settings'
|
||||
className={`link ${
|
||||
(window.location.hash || '#installs') === '#settings'
|
||||
? 'active'
|
||||
: ''
|
||||
}`}
|
||||
>
|
||||
<FontAwesomeIcon icon={faCog} className='mr-1' /> Settings
|
||||
</a>
|
||||
<a
|
||||
draggable={false}
|
||||
href='#leaderboards'
|
||||
className={`link ${
|
||||
(window.location.hash || '#installs') === '#leaderboards'
|
||||
? 'active'
|
||||
: ''
|
||||
}`}
|
||||
>
|
||||
<FontAwesomeIcon icon={faRankingStar} className='mr-1' /> Leaderboards
|
||||
</a>
|
||||
<a
|
||||
draggable={false}
|
||||
onClick={() => openUrl('https://berrydash.lncvrt.xyz/discord')}
|
||||
className='link'
|
||||
>
|
||||
<FontAwesomeIcon icon={faDiscord} className='mr-1' /> Community
|
||||
</a>
|
||||
</nav>
|
||||
<div className='sidebar-downloads' onClick={() => { setPopupMode(1); setShowPopup(true); setFadeOut(false) }}>
|
||||
<p><FontAwesomeIcon icon={faDownload} /> Downloads</p>
|
||||
<div
|
||||
className='sidebar-downloads'
|
||||
style={{ display: downloadProgress.length != 0 ? 'block' : 'none' }}
|
||||
onClick={() => {
|
||||
setPopupMode(1)
|
||||
setShowPopup(true)
|
||||
setFadeOut(false)
|
||||
}}
|
||||
>
|
||||
<p>
|
||||
<FontAwesomeIcon icon={faDownload} /> Downloads
|
||||
</p>
|
||||
</div>
|
||||
</aside>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user