wip
This commit is contained in:
		
							parent
							
								
									2e898c173c
								
							
						
					
					
						commit
						033afba83b
					
				
					 2 changed files with 118 additions and 21 deletions
				
			
		
							
								
								
									
										97
									
								
								src/client/pages/settings/index.link.vue
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										97
									
								
								src/client/pages/settings/index.link.vue
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,97 @@ | ||||||
|  | <template> | ||||||
|  | <div class="qmfkfnzj"> | ||||||
|  | 	<a class="main _button" :href="to" target="_blank" v-if="external"> | ||||||
|  | 		<span class="icon"><slot name="icon"></slot></span> | ||||||
|  | 		<span class="text"><slot></slot></span> | ||||||
|  | 	</a> | ||||||
|  | 	<MkA class="main _button" :class="{ active }" :to="to" :behavior="behavior" v-else> | ||||||
|  | 		<span class="icon"><slot name="icon"></slot></span> | ||||||
|  | 		<span class="text"><slot></slot></span> | ||||||
|  | 	</MkA> | ||||||
|  | </div> | ||||||
|  | </template> | ||||||
|  | 
 | ||||||
|  | <script lang="ts"> | ||||||
|  | import { defineComponent } from 'vue'; | ||||||
|  | 
 | ||||||
|  | export default defineComponent({ | ||||||
|  | 	props: { | ||||||
|  | 		to: { | ||||||
|  | 			type: String, | ||||||
|  | 			required: true | ||||||
|  | 		}, | ||||||
|  | 		active: { | ||||||
|  | 			type: Boolean, | ||||||
|  | 			required: false | ||||||
|  | 		}, | ||||||
|  | 		external: { | ||||||
|  | 			type: Boolean, | ||||||
|  | 			required: false | ||||||
|  | 		}, | ||||||
|  | 		behavior: { | ||||||
|  | 			type: String, | ||||||
|  | 			required: false, | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
|  | 	data() { | ||||||
|  | 		return { | ||||||
|  | 		}; | ||||||
|  | 	} | ||||||
|  | }); | ||||||
|  | </script> | ||||||
|  | 
 | ||||||
|  | <style lang="scss" scoped> | ||||||
|  | .qmfkfnzj { | ||||||
|  | 	> .main { | ||||||
|  | 		display: flex; | ||||||
|  | 		align-items: center; | ||||||
|  | 		width: 100%; | ||||||
|  | 		box-sizing: border-box; | ||||||
|  | 		padding: 10px 16px 10px 14px; | ||||||
|  | 		border-radius: 999px; | ||||||
|  | 		font-size: 0.9em; | ||||||
|  | 
 | ||||||
|  | 		&:hover { | ||||||
|  | 			text-decoration: none; | ||||||
|  | 			background: var(--panelHighlight); | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 		&.active { | ||||||
|  | 			color: var(--accent); | ||||||
|  | 			background: var(--accentedBg); | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 		> .icon { | ||||||
|  | 			width: 32px; | ||||||
|  | 			margin-right: 2px; | ||||||
|  | 			flex-shrink: 0; | ||||||
|  | 			text-align: center; | ||||||
|  | 			opacity: 0.8; | ||||||
|  | 
 | ||||||
|  | 			&:empty { | ||||||
|  | 				display: none; | ||||||
|  | 
 | ||||||
|  | 				& + .text { | ||||||
|  | 					padding-left: 4px; | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 		> .text { | ||||||
|  | 			white-space: nowrap; | ||||||
|  | 			text-overflow: ellipsis; | ||||||
|  | 			overflow: hidden; | ||||||
|  | 			padding-right: 12px; | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 		> .right { | ||||||
|  | 			margin-left: auto; | ||||||
|  | 			opacity: 0.7; | ||||||
|  | 
 | ||||||
|  | 			> .text:not(:empty) { | ||||||
|  | 				margin-right: 0.75em; | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  | </style> | ||||||
|  | @ -7,35 +7,35 @@ | ||||||
| 					<MkAvatar :user="$i" class="avatar"/> | 					<MkAvatar :user="$i" class="avatar"/> | ||||||
| 				</div> | 				</div> | ||||||
| 			</div> | 			</div> | ||||||
| 			<FormLink :active="page === 'accounts'" replace to="/settings/accounts"><template #icon><i class="fas fa-users"></i></template>{{ $ts.accounts }}</FormLink> | 			<XLink :active="page === 'accounts'" replace to="/settings/accounts"><template #icon><i class="fas fa-users"></i></template>{{ $ts.accounts }}</XLink> | ||||||
| 		</FormGroup> | 		</FormGroup> | ||||||
| 		<FormInfo v-if="emailNotConfigured" warn>{{ $ts.emailNotConfiguredWarning }} <MkA to="/settings/email" class="_link">{{ $ts.configure }}</MkA></FormInfo> | 		<FormInfo v-if="emailNotConfigured" warn>{{ $ts.emailNotConfiguredWarning }} <MkA to="/settings/email" class="_link">{{ $ts.configure }}</MkA></FormInfo> | ||||||
| 		<FormGroup> | 		<FormGroup> | ||||||
| 			<template #label>{{ $ts.basicSettings }}</template> | 			<template #label>{{ $ts.basicSettings }}</template> | ||||||
| 			<FormLink :active="page === 'profile'" replace to="/settings/profile"><template #icon><i class="fas fa-user"></i></template>{{ $ts.profile }}</FormLink> | 			<XLink :active="page === 'profile'" replace to="/settings/profile"><template #icon><i class="fas fa-user"></i></template>{{ $ts.profile }}</XLink> | ||||||
| 			<FormLink :active="page === 'privacy'" replace to="/settings/privacy"><template #icon><i class="fas fa-lock-open"></i></template>{{ $ts.privacy }}</FormLink> | 			<XLink :active="page === 'privacy'" replace to="/settings/privacy"><template #icon><i class="fas fa-lock-open"></i></template>{{ $ts.privacy }}</XLink> | ||||||
| 			<FormLink :active="page === 'reaction'" replace to="/settings/reaction"><template #icon><i class="fas fa-laugh"></i></template>{{ $ts.reaction }}</FormLink> | 			<XLink :active="page === 'reaction'" replace to="/settings/reaction"><template #icon><i class="fas fa-laugh"></i></template>{{ $ts.reaction }}</XLink> | ||||||
| 			<FormLink :active="page === 'drive'" replace to="/settings/drive"><template #icon><i class="fas fa-cloud"></i></template>{{ $ts.drive }}</FormLink> | 			<XLink :active="page === 'drive'" replace to="/settings/drive"><template #icon><i class="fas fa-cloud"></i></template>{{ $ts.drive }}</XLink> | ||||||
| 			<FormLink :active="page === 'notifications'" replace to="/settings/notifications"><template #icon><i class="fas fa-bell"></i></template>{{ $ts.notifications }}</FormLink> | 			<XLink :active="page === 'notifications'" replace to="/settings/notifications"><template #icon><i class="fas fa-bell"></i></template>{{ $ts.notifications }}</XLink> | ||||||
| 			<FormLink :active="page === 'email'" replace to="/settings/email"><template #icon><i class="fas fa-envelope"></i></template>{{ $ts.email }}</FormLink> | 			<XLink :active="page === 'email'" replace to="/settings/email"><template #icon><i class="fas fa-envelope"></i></template>{{ $ts.email }}</XLink> | ||||||
| 			<FormLink :active="page === 'integration'" replace to="/settings/integration"><template #icon><i class="fas fa-share-alt"></i></template>{{ $ts.integration }}</FormLink> | 			<XLink :active="page === 'integration'" replace to="/settings/integration"><template #icon><i class="fas fa-share-alt"></i></template>{{ $ts.integration }}</XLink> | ||||||
| 			<FormLink :active="page === 'security'" replace to="/settings/security"><template #icon><i class="fas fa-lock"></i></template>{{ $ts.security }}</FormLink> | 			<XLink :active="page === 'security'" replace to="/settings/security"><template #icon><i class="fas fa-lock"></i></template>{{ $ts.security }}</XLink> | ||||||
| 		</FormGroup> | 		</FormGroup> | ||||||
| 		<FormGroup> | 		<FormGroup> | ||||||
| 			<template #label>{{ $ts.clientSettings }}</template> | 			<template #label>{{ $ts.clientSettings }}</template> | ||||||
| 			<FormLink :active="page === 'general'" replace to="/settings/general"><template #icon><i class="fas fa-cogs"></i></template>{{ $ts.general }}</FormLink> | 			<XLink :active="page === 'general'" replace to="/settings/general"><template #icon><i class="fas fa-cogs"></i></template>{{ $ts.general }}</XLink> | ||||||
| 			<FormLink :active="page === 'theme'" replace to="/settings/theme"><template #icon><i class="fas fa-palette"></i></template>{{ $ts.theme }}</FormLink> | 			<XLink :active="page === 'theme'" replace to="/settings/theme"><template #icon><i class="fas fa-palette"></i></template>{{ $ts.theme }}</XLink> | ||||||
| 			<FormLink :active="page === 'menu'" replace to="/settings/menu"><template #icon><i class="fas fa-list-ul"></i></template>{{ $ts.menu }}</FormLink> | 			<XLink :active="page === 'menu'" replace to="/settings/menu"><template #icon><i class="fas fa-list-ul"></i></template>{{ $ts.menu }}</XLink> | ||||||
| 			<FormLink :active="page === 'sounds'" replace to="/settings/sounds"><template #icon><i class="fas fa-music"></i></template>{{ $ts.sounds }}</FormLink> | 			<XLink :active="page === 'sounds'" replace to="/settings/sounds"><template #icon><i class="fas fa-music"></i></template>{{ $ts.sounds }}</XLink> | ||||||
| 			<FormLink :active="page === 'plugin'" replace to="/settings/plugin"><template #icon><i class="fas fa-plug"></i></template>{{ $ts.plugins }}</FormLink> | 			<XLink :active="page === 'plugin'" replace to="/settings/plugin"><template #icon><i class="fas fa-plug"></i></template>{{ $ts.plugins }}</XLink> | ||||||
| 		</FormGroup> | 		</FormGroup> | ||||||
| 		<FormGroup> | 		<FormGroup> | ||||||
| 			<template #label>{{ $ts.otherSettings }}</template> | 			<template #label>{{ $ts.otherSettings }}</template> | ||||||
| 			<FormLink :active="page === 'import-export'" replace to="/settings/import-export"><template #icon><i class="fas fa-boxes"></i></template>{{ $ts.importAndExport }}</FormLink> | 			<XLink :active="page === 'import-export'" replace to="/settings/import-export"><template #icon><i class="fas fa-boxes"></i></template>{{ $ts.importAndExport }}</XLink> | ||||||
| 			<FormLink :active="page === 'mute-block'" replace to="/settings/mute-block"><template #icon><i class="fas fa-ban"></i></template>{{ $ts.muteAndBlock }}</FormLink> | 			<XLink :active="page === 'mute-block'" replace to="/settings/mute-block"><template #icon><i class="fas fa-ban"></i></template>{{ $ts.muteAndBlock }}</XLink> | ||||||
| 			<FormLink :active="page === 'word-mute'" replace to="/settings/word-mute"><template #icon><i class="fas fa-comment-slash"></i></template>{{ $ts.wordMute }}</FormLink> | 			<XLink :active="page === 'word-mute'" replace to="/settings/word-mute"><template #icon><i class="fas fa-comment-slash"></i></template>{{ $ts.wordMute }}</XLink> | ||||||
| 			<FormLink :active="page === 'api'" replace to="/settings/api"><template #icon><i class="fas fa-key"></i></template>API</FormLink> | 			<XLink :active="page === 'api'" replace to="/settings/api"><template #icon><i class="fas fa-key"></i></template>API</XLink> | ||||||
| 			<FormLink :active="page === 'other'" replace to="/settings/other"><template #icon><i class="fas fa-ellipsis-h"></i></template>{{ $ts.other }}</FormLink> | 			<XLink :active="page === 'other'" replace to="/settings/other"><template #icon><i class="fas fa-ellipsis-h"></i></template>{{ $ts.other }}</XLink> | ||||||
| 		</FormGroup> | 		</FormGroup> | ||||||
| 		<FormGroup> | 		<FormGroup> | ||||||
| 			<FormButton @click="clear">{{ $ts.clearCache }}</FormButton> | 			<FormButton @click="clear">{{ $ts.clearCache }}</FormButton> | ||||||
|  | @ -53,7 +53,7 @@ | ||||||
| <script lang="ts"> | <script lang="ts"> | ||||||
| import { computed, defineAsyncComponent, defineComponent, nextTick, onMounted, reactive, ref, watch } from 'vue'; | import { computed, defineAsyncComponent, defineComponent, nextTick, onMounted, reactive, ref, watch } from 'vue'; | ||||||
| import { i18n } from '@client/i18n'; | import { i18n } from '@client/i18n'; | ||||||
| import FormLink from './index.link.vue'; | import XLink from './index.link.vue'; | ||||||
| import FormGroup from '@client/components/debobigego/group.vue'; | import FormGroup from '@client/components/debobigego/group.vue'; | ||||||
| import FormBase from '@client/components/debobigego/base.vue'; | import FormBase from '@client/components/debobigego/base.vue'; | ||||||
| import FormButton from '@client/components/debobigego/button.vue'; | import FormButton from '@client/components/debobigego/button.vue'; | ||||||
|  | @ -68,7 +68,7 @@ import { $i } from '@client/account'; | ||||||
| export default defineComponent({ | export default defineComponent({ | ||||||
| 	components: { | 	components: { | ||||||
| 		FormBase, | 		FormBase, | ||||||
| 		FormLink, | 		XLink, | ||||||
| 		FormGroup, | 		FormGroup, | ||||||
| 		FormButton, | 		FormButton, | ||||||
| 		FormInfo, | 		FormInfo, | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue