mango-v4-ui/components/settings/SettingsPage.tsx

54 lines
2.2 KiB
TypeScript
Raw Normal View History

2023-06-22 20:37:34 -07:00
import { useViewport } from 'hooks/useViewport'
2022-11-24 18:39:14 -08:00
import AnimationSettings from './AnimationSettings'
import DisplaySettings from './DisplaySettings'
2023-06-20 16:16:58 -07:00
import HotKeysSettings from './HotKeysSettings'
import NotificationSettings from './NotificationSettings'
2022-11-24 18:39:14 -08:00
import PreferredExplorerSettings from './PreferredExplorerSettings'
2022-12-15 04:28:17 -08:00
import RpcSettings from './RpcSettings'
2022-11-24 18:39:14 -08:00
import SoundSettings from './SoundSettings'
2023-06-22 20:37:34 -07:00
import { breakpoints } from 'utils/theme'
2023-08-06 06:30:48 -07:00
import AccountSettings from './AccountSettings'
2023-08-10 05:26:02 -07:00
import useMangoAccount from 'hooks/useMangoAccount'
import useUnownedAccount from 'hooks/useUnownedAccount'
2022-11-24 18:39:14 -08:00
const SettingsPage = () => {
2023-06-22 20:37:34 -07:00
const { width } = useViewport()
2023-08-10 05:26:02 -07:00
const { mangoAccountAddress } = useMangoAccount()
const { isUnownedAccount } = useUnownedAccount()
2023-06-22 20:37:34 -07:00
const isMobile = width ? width < breakpoints.lg : false
2022-11-24 18:39:14 -08:00
return (
<div className="grid grid-cols-12">
<div className="col-span-12 border-b border-th-bkg-3 lg:col-span-10 lg:col-start-2 xl:col-span-8 xl:col-start-3">
2022-12-15 04:28:17 -08:00
<RpcSettings />
</div>
2023-08-10 05:26:02 -07:00
{mangoAccountAddress && !isUnownedAccount ? (
<div className="col-span-12 border-b border-th-bkg-3 pt-8 lg:col-span-10 lg:col-start-2 xl:col-span-8 xl:col-start-3">
<AccountSettings />
</div>
) : null}
2023-08-06 06:30:48 -07:00
<div className="col-span-12 border-b border-th-bkg-3 pt-8 lg:col-span-10 lg:col-start-2 xl:col-span-8 xl:col-start-3">
2022-11-24 18:39:14 -08:00
<DisplaySettings />
</div>
2023-06-22 20:37:34 -07:00
<div className="col-span-12 pt-8 lg:col-span-10 lg:col-start-2 xl:col-span-8 xl:col-start-3">
2023-05-08 04:59:46 -07:00
<NotificationSettings />
2022-11-24 18:39:14 -08:00
</div>
2023-06-22 20:37:34 -07:00
{!isMobile ? (
<div className="col-span-12 pt-8 lg:col-span-10 lg:col-start-2 xl:col-span-8 xl:col-start-3">
<HotKeysSettings />
</div>
) : null}
<div className="col-span-12 border-b border-th-bkg-3 pt-8 lg:col-span-10 lg:col-start-2 xl:col-span-8 xl:col-start-3">
2023-05-08 04:59:46 -07:00
<AnimationSettings />
2022-11-24 18:39:14 -08:00
</div>
<div className="col-span-12 border-b border-th-bkg-3 pt-8 lg:col-span-10 lg:col-start-2 xl:col-span-8 xl:col-start-3">
2023-05-08 04:59:46 -07:00
<SoundSettings />
</div>
<div className="col-span-12 pt-8 lg:col-span-10 lg:col-start-2 xl:col-span-8 xl:col-start-3">
2022-11-24 18:39:14 -08:00
<PreferredExplorerSettings />
</div>
</div>
)
}
export default SettingsPage