-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add profile actions buttons and use it for settings (#5489)
Co-authored-by: MarkNerdi <105642810+MarkNerdi@users.noreply.github.com>
- Loading branch information
1 parent
84b864b
commit b4b18f7
Showing
6 changed files
with
126 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
81 changes: 81 additions & 0 deletions
81
packages/mobile/components/buttons/ProfileActionButton.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<script lang="typescript"> | ||
import { Icon as IconEnum } from '@lib/auxiliary/icon' | ||
import { FontWeight, Icon, Text, TextType } from 'shared/components' | ||
export let primaryText: string = '' | ||
export let secondaryText: string = '' | ||
export let icon: IconEnum = undefined | ||
export let iconColor: string = 'blue-500' | ||
export let disabled: boolean = false | ||
export let classes: string = '' | ||
export let color: string = 'transparent' | ||
export let onClick: () => unknown | ||
const secondaryIcon = IconEnum.ChevronRight | ||
const secondaryIconColor = 'gray-500' | ||
</script> | ||
|
||
<button | ||
type="button" | ||
{disabled} | ||
class="w-full rounded-xl p-4 cursor-pointer text-left border border-solid border-{color === 'transparent' | ||
? 'gray-200' | ||
: color} dark:border-{color === 'transparent' ? 'gray-600' : color} bg-{color} bg-opacity-30 {classes}" | ||
on:click|stopPropagation={onClick} | ||
> | ||
<div class="grid grid-cols-12 gap-4"> | ||
{#if icon} | ||
<div class="col-span-1 h-full flex justify-center items-center justify-items-center"> | ||
<Icon height={24} width={24} {icon} classes="text-{iconColor}" /> | ||
</div> | ||
{/if} | ||
<div | ||
class=" | ||
h-full flex items-center | ||
{icon ? 'col-start-2' : 'col-start-1'} | ||
{!disabled ? 'col-end-12' : 'col-end-13'} | ||
" | ||
> | ||
<span class="flex flex-col justify-center space-y-0.5"> | ||
<Text | ||
type={TextType.p} | ||
color="gray-800" | ||
darkColor="white" | ||
fontSize="14" | ||
fontWeight={FontWeight.semibold} | ||
lineHeight="5" | ||
> | ||
{primaryText} | ||
</Text> | ||
{#if secondaryText} | ||
<Text | ||
type={TextType.p} | ||
color="gray-600" | ||
darkColor="gray-400" | ||
fontSize="12" | ||
fontWeight={FontWeight.normal} | ||
lineHeight="3.5" | ||
> | ||
{secondaryText} | ||
</Text> | ||
{/if} | ||
</span> | ||
</div> | ||
<div class="col-span-1 col-end-13 h-full flex justify-center items-center justify-items-center"> | ||
<Icon icon={secondaryIcon} classes="text-{secondaryIconColor}" /> | ||
</div> | ||
</div> | ||
</button> | ||
|
||
<style type="text/scss"> | ||
button { | ||
&:disabled { | ||
@apply pointer-events-none; | ||
@apply opacity-50; | ||
:global(svg) { | ||
@apply text-gray-500; | ||
} | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export { default as AccountActionsButton } from './AccountActionsButton.svelte' | ||
export { default as AccountSwitcherButton } from './AccountSwitcherButton.svelte' | ||
export { default as ProfileActionsButton } from './ProfileActionsButton.svelte' | ||
export { default as DashboardProfileButton } from './DashboardProfileButton.svelte' | ||
export { default as ProfileActionButton } from './ProfileActionButton.svelte' | ||
export { default as ProfileButton } from './ProfileButton.svelte' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters