Skip to content

Commit 6f2c0f7

Browse files
committed
Buttons | Dialog
1 parent d19ae67 commit 6f2c0f7

File tree

4 files changed

+114
-3
lines changed

4 files changed

+114
-3
lines changed

03-issuesApp/.env

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
GITHUB_TOKEN=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
2-
GITHUB_USER=facebook
3-
GITHUB_REPO=react
2+
# GITHUB_USER=facebook
3+
# GITHUB_REPO=react
4+
GITHUB_USER=diazdesandi
5+
GITHUB_REPO=VueTS
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<script setup lang="ts">
2+
interface Props {
3+
buttons: Button[];
4+
}
5+
6+
interface Button {
7+
action: () => void;
8+
color?: string;
9+
icon: string;
10+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
11+
}
12+
13+
defineProps<Props>();
14+
</script>
15+
<template>
16+
<div class="fab">
17+
<q-btn
18+
class="q-mr-sm"
19+
v-for="button of buttons"
20+
:key="button.icon"
21+
round
22+
:color="button.color || 'primary'"
23+
:icon="button.icon"
24+
:size="button.size || 'lg'"
25+
@click="button.action"
26+
/>
27+
</div>
28+
</template>
29+
<style scoped>
30+
.fab {
31+
position: fixed;
32+
bottom: 30px;
33+
right: 30px;
34+
}
35+
</style>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<script setup lang="ts">
2+
import { ref } from 'vue';
3+
4+
const isOpen = ref<boolean>(true);
5+
6+
const title = ref<string>('');
7+
const body = ref<string>('');
8+
const labels = ref<string[]>([]);
9+
</script>
10+
<template>
11+
<div class="q-pa-md q-gutter-sm">
12+
<q-dialog v-model="isOpen" position="bottom">
13+
<q-card style="width: 500px">
14+
<q-form>
15+
<q-linear-progress :value="1" color="primary" />
16+
17+
<q-card-section class="column no-wrap">
18+
<div class="text-weight-bold">New Issue</div>
19+
<div class="text-grey">Add new Issue</div>
20+
<q-space />
21+
<div>
22+
<q-input
23+
filled
24+
v-model="title"
25+
label="Ttitle"
26+
placeholder="Title"
27+
class="q-mb-sm"
28+
/>
29+
<q-select
30+
filled
31+
v-model="labels"
32+
multiple
33+
:options="[]"
34+
use-chips
35+
stack-label
36+
label="Multiple selection"
37+
class="q-mb-sm"
38+
/>
39+
<!-- TODO: Markdown Editor -->
40+
</div>
41+
</q-card-section>
42+
<q-card-actions align="left">
43+
<q-btn flat label="Cancel" v-close-popup color="dark" />
44+
<q-space />
45+
<q-btn type="submit" flat label="Add" v-close-popup color="dark" />
46+
</q-card-actions>
47+
</q-form>
48+
</q-card>
49+
</q-dialog>
50+
</div>
51+
</template>
52+
<style scoped></style>

03-issuesApp/src/issues/pages/ListPage.vue

+23-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@ import LoaderSpinner from 'src/shared/components/LoaderSpinner.vue';
33
import FilterSelector from '../components/filter-selector/FilterSelector.vue';
44
import IssueList from 'src/issues/components/issue-list/IssueList.vue';
55
import useIssues from '../composables/useIssues';
6+
import FloatingButtons from '../components/FloatingButtons.vue';
7+
import NewIssueDialog from '../components/NewIssueDialog.vue';
68
79
const { issuesQuery } = useIssues();
10+
11+
const listPageClickTemp = () => {
12+
console.log('ListPageClickTemp');
13+
};
814
</script>
915
<template>
1016
<div class="row q-mb-md">
@@ -15,7 +21,6 @@ const { issuesQuery } = useIssues();
1521

1622
<div class="row">
1723
<div class="col-xs-12 col-md-4">
18-
<!-- TODO: Filtros -->
1924
<FilterSelector />
2025
</div>
2126

@@ -24,6 +29,23 @@ const { issuesQuery } = useIssues();
2429
<IssueList v-else :issues="issuesQuery.data?.value || []" />
2530
</div>
2631
</div>
32+
33+
<!-- FloatingButtons -->
34+
<FloatingButtons
35+
:buttons="[
36+
{
37+
action: listPageClickTemp,
38+
color: 'primary',
39+
icon: 'add',
40+
size: 'lg',
41+
},
42+
]"
43+
/>
44+
45+
<!-- New Issue -->
46+
47+
<NewIssueDialog />
48+
2749
</template>
2850

2951
<style scoped></style>

0 commit comments

Comments
 (0)