-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(settings-profile): account link component/markup (#3953)
* feat(settings-profile): account link component/markup * fix(settings-profile): tweak spacing for main section in profile settings * refactor(profile): create transition .less function and move keyframes to global sheet * refactor(accounts): remove html wrappers and simplify css, move component files * fix(profile): v bind typo fix * fix(profile): typo * fix(profile): show controls on mobile and remove spacer Co-authored-by: Joe McGrath <[email protected]>
- Loading branch information
1 parent
f13b194
commit 0f2a1d7
Showing
9 changed files
with
297 additions
and
32 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<template> | ||
<div class="list"> | ||
<SettingsProfileAccountsItem | ||
v-for="account in accounts" | ||
:key="account.name" | ||
:account="account" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue from 'vue' | ||
import { TwitchIcon, YoutubeIcon, TwitterIcon } from 'satellite-lucide-icons' | ||
type Account = { | ||
name: string | ||
icon: string | ||
isVerified: boolean | ||
displayOnProfile: boolean | ||
} | ||
export default Vue.extend({ | ||
data() { | ||
return { | ||
accounts: { | ||
reddit: { | ||
name: 'Reddit', | ||
// TODO: Add icon | ||
icon: 'reddit', | ||
username: '', | ||
isVerified: false, | ||
displayOnProfile: true, | ||
verifyUrl: 'https://www.reddit.com/', | ||
}, | ||
twitch: { | ||
name: 'Twitch', | ||
icon: TwitchIcon, | ||
username: 'Sophia_Kalindi', | ||
isVerified: true, | ||
displayOnProfile: true, | ||
verifyUrl: 'https://www.twitch.com/', | ||
}, | ||
youtube: { | ||
name: 'Youtube', | ||
icon: YoutubeIcon, | ||
username: 'Sophia_Kalindi94', | ||
isVerified: false, | ||
displayMusic: false, | ||
displayOnProfile: true, | ||
verifyUrl: 'https://www.youtube.com/', | ||
}, | ||
twitter: { | ||
name: 'Twitter', | ||
icon: TwitterIcon, | ||
username: 'Sophia_Kalindi94', | ||
isVerified: true, | ||
displayOnProfile: true, | ||
verifyUrl: 'https://www.twitter.com/', | ||
}, | ||
spotify: { | ||
name: 'Spotify', | ||
// TODO: Add icon | ||
icon: 'spotify', | ||
username: '', | ||
isVerified: false, | ||
displayMusic: true, | ||
displayOnProfile: true, | ||
verifyUrl: 'https://www.spotify.com/', | ||
}, | ||
}, | ||
} | ||
}, | ||
methods: { | ||
toggleAccount(account: Account) { | ||
account.displayOnProfile = !account.displayOnProfile | ||
}, | ||
}, | ||
}) | ||
</script> | ||
|
||
<style scoped lang="less"> | ||
.list { | ||
display: flex; | ||
flex-direction: column; | ||
gap: @large-spacing; | ||
} | ||
</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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<div class="list-item"> | ||
<div class="header" :class="{'no-bottom-radius': account.isVerified}"> | ||
<component class="icon" :is="account.icon" size="1.3x" /> | ||
<div class="titles"> | ||
<TypographyTitle :size="6" :text="account.name" /> | ||
<TypographySubtitle | ||
v-if="account.username" | ||
:size="6" | ||
:text="account.username" | ||
class="username" | ||
/> | ||
</div> | ||
<InteractablesButton | ||
v-if="!account.isVerified" | ||
type="primary" | ||
size="small" | ||
:action="() => {}" | ||
:text="$t('pages.settings.profile.accounts.verify')" | ||
/> | ||
<div v-else class="controls"> | ||
<button class="edit-button" @click="() => {}"> | ||
{{$t('global.edit')}} | ||
</button> | ||
<button class="edit-button" @click="() => {}"> | ||
<x-icon size="1x" /> | ||
</button> | ||
</div> | ||
</div> | ||
<div v-if="account.isVerified" class="display-details"> | ||
<div class="display-row"> | ||
<TypographyText | ||
:size="6" | ||
:text="$t('pages.settings.profile.accounts.displayMusic')" | ||
class="music-label" | ||
/> | ||
<InteractablesSwitch v-model="account.displayMusic" /> | ||
</div> | ||
<div class="display-row"> | ||
<TypographyText | ||
:size="6" | ||
:text="$t('pages.settings.profile.accounts.displayOnProfile')" | ||
class="music-label" | ||
/> | ||
<InteractablesSwitch v-model="account.displayOnProfile" /> | ||
</div> | ||
</div> | ||
</div> |
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,92 @@ | ||
.list-item { | ||
&:hover, | ||
&:focus-within { | ||
.header { | ||
background: @foreground; | ||
.transition(background, @animation-speed, ease-in-out); | ||
|
||
.controls { | ||
opacity: 1; | ||
.transition(opacity, @animation-speed, ease-in-out); | ||
} | ||
} | ||
} | ||
|
||
.header { | ||
display: flex; | ||
align-items: center; | ||
gap: @normal-spacing; | ||
padding: @normal-spacing; | ||
background: @midground-alt; | ||
&:extend(.round-corners); | ||
.transition(background, @animation-speed, ease-in-out); | ||
|
||
&.no-bottom-radius { | ||
border-bottom-left-radius: 0; | ||
border-bottom-right-radius: 0; | ||
} | ||
|
||
.titles { | ||
flex: 1; | ||
&:extend(.ellipsis); | ||
.username { | ||
&:extend(.ellipsis); | ||
margin-top: @light-spacing; | ||
} | ||
} | ||
|
||
.button, | ||
.controls { | ||
flex-shrink: 0; | ||
} | ||
|
||
.controls { | ||
display: flex; | ||
gap: @normal-spacing; | ||
opacity: 0; | ||
.transition(opacity, @animation-speed, ease-in-out); | ||
|
||
.edit-button { | ||
display: flex; | ||
align-items: center; | ||
font-style: italic; | ||
white-space: nowrap; | ||
color: @satellite-color; | ||
|
||
&:hover, | ||
&:focus { | ||
opacity: 0.8; | ||
} | ||
} | ||
} | ||
} | ||
|
||
.display-details { | ||
display: flex; | ||
flex-direction: column; | ||
padding: @normal-spacing; | ||
gap: @light-spacing; | ||
&:extend(.bordered); | ||
border-width: 2px; | ||
border-top: none; | ||
&:extend(.round-corners); | ||
border-top-left-radius: 0; | ||
border-top-right-radius: 0; | ||
|
||
.display-row { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
} | ||
} | ||
} | ||
|
||
@media only screen and (max-width: @mobile-breakpoint) { | ||
.list-item { | ||
.header { | ||
.controls { | ||
opacity: 1; | ||
} | ||
} | ||
} | ||
} |
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,29 @@ | ||
<template src="./Item.html"></template> | ||
|
||
<script lang="ts"> | ||
import Vue, { PropType } from 'vue' | ||
import { XIcon } from 'satellite-lucide-icons' | ||
type Account = { | ||
name: string | ||
icon: string | ||
username: string | ||
isVerified: boolean | ||
displayOnProfile: boolean | ||
verifyUrl: string | ||
} | ||
export default Vue.extend({ | ||
components: { | ||
XIcon, | ||
}, | ||
props: { | ||
account: { | ||
type: Object as PropType<Account>, | ||
required: true, | ||
}, | ||
}, | ||
}) | ||
</script> | ||
|
||
<style scoped lang="less" src="./Item.less"></style> |
Oops, something went wrong.