-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
components(calculator/share-dialog): major refactor
- Loading branch information
Showing
3 changed files
with
108 additions
and
138 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
@import "./dialog.scss"; | ||
// FIXME: Removing this causes SASS error. | ||
@import "~vuetify/src/styles/styles.sass"; |
This file was deleted.
Oops, something went wrong.
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,140 +1,141 @@ | ||
<template> | ||
<v-dialog | ||
:value="value" | ||
:value="props.value" | ||
:fullscreen="$vuetify.breakpoint.smAndDown" | ||
:transition="transition" | ||
content-class="vh-dialog" | ||
:transition="$vuetify.breakpoint.smAndDown ? 'dialog-bottom-transition' : 'dialog-transition'" | ||
overlay-color="#000" | ||
overlay-opacity=".75" | ||
width="700" | ||
@click:outside="close()" | ||
@close="close()"> | ||
<div class="vh-dialog__header"> | ||
<v-toolbar | ||
class="px-2" | ||
elevation="0"> | ||
<v-toolbar-title class="text-center"> | ||
Sonuçları paylaş | ||
</v-toolbar-title> | ||
<v-toolbar flat=""> | ||
<v-toolbar-title> | ||
Sonuçları paylaş | ||
</v-toolbar-title> | ||
|
||
<v-spacer /> | ||
<v-spacer /> | ||
|
||
<v-btn | ||
icon="" | ||
@click="close()"> | ||
<v-icon> | ||
{{ icons.mdiClose }} | ||
</v-icon> | ||
</v-btn> | ||
</v-toolbar> | ||
<v-btn | ||
icon="" | ||
@click="close()"> | ||
<v-icon> | ||
{{ mdiClose }} | ||
</v-icon> | ||
</v-btn> | ||
|
||
<v-tabs | ||
v-model="currentTab" | ||
:grow="$vuetify.breakpoint.mdAndDown" | ||
:fixed-tabs="!$vuetify.breakpoint.mdAndDown" | ||
class="vh-share-tabs" | ||
background-color="transparent"> | ||
<v-tab> | ||
<v-icon left=""> | ||
{{ icons.mdiLink }} | ||
</v-icon> | ||
<span>Bağlantı</span> | ||
</v-tab> | ||
<v-tab> | ||
<v-icon left=""> | ||
{{ icons.mdiCellphoneScreenshot }} | ||
</v-icon> | ||
<span>Ekran Görüntüsü</span> | ||
</v-tab> | ||
</v-tabs> | ||
</div> | ||
<template #extension> | ||
<v-tabs | ||
v-model="currentTab" | ||
fixed-tabs=""> | ||
<v-tab> | ||
<v-icon left=""> | ||
{{ mdiLink }} | ||
</v-icon> | ||
<span>Bağlantı</span> | ||
</v-tab> | ||
<v-tab> | ||
<v-icon left=""> | ||
{{ mdiCellphoneScreenshot }} | ||
</v-icon> | ||
<span>Ekran Görüntüsü</span> | ||
</v-tab> | ||
</v-tabs> | ||
</template> | ||
</v-toolbar> | ||
|
||
<div class="vh-dialog__content"> | ||
<div class="body"> | ||
<template v-if="currentTab === 0"> | ||
<div class="d-flex flex-column h-100"> | ||
<div class="mt-auto py-10 px-6 py-lg-12 px-lg-8"> | ||
<lazy-calculator-share-dialog-url :form="form" /> | ||
</div> | ||
<div class="mt-auto py-10 px-6 py-lg-12 px-lg-8"> | ||
<lazy-calculator-share-dialog-url :form="props.form" /> | ||
</div> | ||
</template> | ||
<template v-else-if="currentTab === 1"> | ||
<div class="d-flex flex-column h-100"> | ||
<div class="mt-auto py-10 py-lg-6 px-2"> | ||
<calculator-share-dialog-screenshot | ||
:input="screenshotInput" | ||
:output="screenshotOutput" | ||
:calculator-title="calculatorTitle" | ||
:preset-title="presetTitle" | ||
:preset-option-title="presetOptionTitle" /> | ||
</div> | ||
<div class="mt-auto py-10 py-lg-6 px-2"> | ||
<calculator-share-dialog-screenshot | ||
:input="props.screenshotInput" | ||
:output="props.screenshotOutput" | ||
:calculator-title="props.calculatorTitle" | ||
:preset-title="props.presetTitle" | ||
:preset-option-title="props.presetOptionTitle" /> | ||
</div> | ||
</template> | ||
</div> | ||
</v-dialog> | ||
</template> | ||
|
||
<script> | ||
<script setup=""> | ||
import { mdiCellphoneScreenshot, mdiClose, mdiLink } from "@mdi/js"; | ||
import { ref } from "vue"; | ||
export default { | ||
data: () => ({ | ||
icons: { | ||
mdiClose, | ||
mdiLink, | ||
mdiCellphoneScreenshot | ||
}, | ||
currentTab: 0 | ||
}), | ||
props: { | ||
value: { | ||
type: Boolean | ||
}, | ||
form: { | ||
type: Object, | ||
required: true | ||
}, | ||
screenshotInput: { | ||
type: Array, | ||
default: () => ([]) | ||
}, | ||
screenshotOutput: { | ||
type: Array, | ||
required: true | ||
}, | ||
calculatorTitle: { | ||
type: String, | ||
required: true | ||
}, | ||
presetTitle: { | ||
type: String, | ||
default: null | ||
}, | ||
presetOptionTitle: { | ||
type: String, | ||
default: null | ||
} | ||
const props = defineProps({ | ||
value: { | ||
type: Boolean | ||
}, | ||
methods: { | ||
close() { | ||
const vm = this; | ||
vm.$emit("input", false); | ||
} | ||
form: { | ||
type: Object, | ||
required: true | ||
}, | ||
computed: { | ||
transition() { | ||
const vm = this; | ||
return vm.$vuetify.breakpoint.smAndDown ? | ||
"dialog-bottom-transition" : | ||
"dialog-transition"; | ||
} | ||
screenshotInput: { | ||
type: Array, | ||
default: () => ([]) | ||
}, | ||
screenshotOutput: { | ||
type: Array, | ||
required: true | ||
}, | ||
calculatorTitle: { | ||
type: String, | ||
required: true | ||
}, | ||
presetTitle: { | ||
type: String, | ||
default: null | ||
}, | ||
presetOptionTitle: { | ||
type: String, | ||
default: null | ||
} | ||
}); | ||
const emit = defineEmits(["input"]); | ||
const currentTab = ref(0); | ||
const close = () => { | ||
emit("input", false); | ||
}; | ||
</script> | ||
|
||
<style lang="scss" scoped=""> | ||
@import "~vuetify/src/styles/styles.sass"; | ||
.vh-share-tabs { | ||
background: map-get($material-dark-elevation-colors, "4") | ||
:deep(.v-dialog) { | ||
display: flex; | ||
flex-flow: column nowrap; | ||
background: map-get($material-dark-elevation-colors, "1"); | ||
.v-toolbar { | ||
flex: 0 | ||
} | ||
.body { | ||
display: flex; | ||
flex-direction: column; | ||
height: 100%; | ||
overflow-y: auto; | ||
flex: 1 | ||
} | ||
} | ||
@media #{map-get($display-breakpoints, "sm-and-down")} { | ||
html:has(.v-dialog.v-dialog--active) { | ||
position: fixed; | ||
&, body { | ||
width: 100%; | ||
height: 100%; | ||
inset: 0; | ||
overflow: hidden | ||
} | ||
body { | ||
position: absolute | ||
} | ||
} | ||
} | ||
</style> |