Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract buttons from pages so the animation does not affect them #993

Merged
merged 2 commits into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/firstrunwizard-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/firstrunwizard-main.js.map

Large diffs are not rendered by default.

38 changes: 35 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,19 @@
<div v-if="page === 1" class="first-run-wizard__logo" :style="logoStyle" />
<Transition :name="pageSlideDirection"
mode="out-in">
<Page1 v-if="page === 1" @next="goToNextPage" />
<Page2 v-else-if="page === 2" @next="goToNextPage" />
<Page3 v-else-if="page === 3" @close="close" />
<Page1 v-if="page === 1" />
<Page2 v-else-if="page === 2" />
<Page3 v-else-if="page === 3" />
</Transition>
<NcButton type="primary"
alignment="center-reverse"
:wide="true"
@click="handleButtonCLick">
<template v-if="page !== 3" #icon>
<ArrowRight :size="20" />
</template>
{{ buttonText }}
</NcButton>
</div>
</NcModal>
</template>
Expand All @@ -77,6 +86,7 @@ import Page2 from './components/Page2.vue'
import Page3 from './components/Page3.vue'

import ArrowLeft from 'vue-material-design-icons/ArrowLeft.vue'
import ArrowRight from 'vue-material-design-icons/ArrowRight.vue'
import Close from 'vue-material-design-icons/Close.vue'

export default {
Expand All @@ -88,6 +98,7 @@ export default {
Page2,
NcButton,
ArrowLeft,
ArrowRight,
Page3,
Close,
},
Expand Down Expand Up @@ -122,6 +133,17 @@ export default {
return this.page < 3
}
},

buttonText() {
if (this.page === 1) {
return t('firstrunwizard', 'Nextcloud on all your devices')
} else if (this.page === 2) {
return t('firstrunwizard', 'More about Nextcloud')
} else if (this.page === 3) {
return t('firstrunwizard', 'Get started!')
}
return ''
},
},

methods: {
Expand Down Expand Up @@ -156,6 +178,14 @@ export default {
})

},

handleButtonCLick() {
if (this.page < 3) {
this.goToNextPage()
} else {
this.close()
}
},
},
}
</script>
Expand All @@ -168,6 +198,8 @@ export default {
overflow: hidden;
padding: calc(var(--default-grid-baseline) * 5);
display: flex;
flex-direction: column;
justify-content: space-between;
min-height: min(520px, 80vh);
}

Expand Down
14 changes: 0 additions & 14 deletions src/components/Page1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,6 @@
</Card>
</div>
</div>
<NcButton type="primary"
alignment="center-reverse"
:wide="true"
@click="$emit('next')">
<template #icon>
<ArrowRight :size="20" />
</template>
{{ t('firstrunwizard', 'Nextcloud on all your devices') }}
</NcButton>
</div>
</template>

Expand All @@ -65,9 +56,6 @@ import Lock from 'vue-material-design-icons/Lock.vue'
import BriefcaseCheck from 'vue-material-design-icons/BriefcaseCheck.vue'
import SwapHorizontal from 'vue-material-design-icons/SwapHorizontal.vue'
import AccountGroup from 'vue-material-design-icons/AccountGroup.vue'
import ArrowRight from 'vue-material-design-icons/ArrowRight.vue'

import { NcButton } from '@nextcloud/vue'

export default {
name: 'Page1',
Expand All @@ -78,8 +66,6 @@ export default {
BriefcaseCheck,
SwapHorizontal,
AccountGroup,
NcButton,
ArrowRight,
},
}
</script>
Expand Down
14 changes: 1 addition & 13 deletions src/components/Page2.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,19 @@
:title="t('firstrunwizard', 'Calendar and contacts ↗')"
:subtitle="t('firstrunwizard', 'Connect your calendar and contacts with your devices.')" />
</div>
</div><NcButton type="primary"
alignment="center-reverse"
:wide="true"
@click="$emit('next')">
<template #icon>
<ArrowRight :size="20" />
</template>
{{ t('firstrunwizard', 'More about Nextcloud') }}
</NcButton>
</div>
</div>
</template>

<script>
import Card from './Card.vue'
import AppStoreBadge from './AppStoreBadge.vue'
import ArrowRight from 'vue-material-design-icons/ArrowRight.vue'
import { NcButton } from '@nextcloud/vue'
import { generateUrl } from '@nextcloud/router'

export default {
name: 'Page2',

components: {
NcButton,
ArrowRight,
Card,
AppStoreBadge,
},
Expand Down
9 changes: 1 addition & 8 deletions src/components/Page3.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,17 @@
<p class="version-number">
{{ versionNumbrer }}
</p>
</div><NcButton type="primary"
alignment="center-reverse"
:wide="true"
@click="$emit('close')">
{{ t('firstrunwizard', 'Get started!') }}
</NcButton>
</div>
</div>
</template>

<script>
import Card from './Card.vue'
import { NcButton } from '@nextcloud/vue'

export default {
name: 'Page3',

components: {
NcButton,
Card,
},

Expand Down
Loading