-
-
Notifications
You must be signed in to change notification settings - Fork 170
Break resources in multiple json files & add to vuex module store #91
Changes from 15 commits
d20423c
44cf7cb
8f7730c
f86ca12
23416bc
f1a8d05
48aeb6f
b40e3ae
a57aa26
ba47943
6912a96
cf327d0
367e540
fa8dd2e
576d40d
5b9b492
71150c7
27aaee2
72b2fa3
e37f5c9
215eab1
fa72e83
aa03bed
4e4aa46
a10f5d7
e3a786b
2a18f11
5910c42
967cdfb
f02cf32
1e499c7
b936bf1
2832b2f
4314632
68dfacd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,19 +4,34 @@ | |
template(v-for='category in categories') | ||
//- nuxt-link(:to='$i18n.path(category.slug)') {{ category.title }} | ||
nuxt-link(:to='category.slug') {{ category.title }} | ||
div(class="toggleWrapper" @click="toggleCardsShown") | ||
div(class="viewToggle" :class="{active: cardsShown}") Cards | ||
div(class="viewToggle" :class="{active: !cardsShown}") Table | ||
</template> | ||
|
||
<script> | ||
import { mapMutations } from "vuex"; | ||
|
||
export default { | ||
data() { | ||
return { | ||
categories: [{ slug: '', title: '' }], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well i guess we should define now if single or double quotes - the codebase is already mixed with both. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Think we should do this when we implement Prettier, I think I want to do this as the next thing. |
||
categories: [{ slug: "", title: "" }] | ||
}; | ||
}, | ||
computed: { | ||
cardsShown() { | ||
return this.$store.getters['Sidebar/isCardsShown'] | ||
} | ||
}, | ||
created() { | ||
this.categories = this.$store.getters['data/resources'].map(({ title, slug }) => ({ title, slug })) | ||
}, | ||
methods: { | ||
...mapMutations({ | ||
toggleCardsShown: "Sidebar/toggleCardsShown" | ||
}) | ||
} | ||
} | ||
}; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
|
@@ -29,6 +44,27 @@ export default { | |
padding: 0.5rem 1rem 0.5rem 1rem; | ||
font-weight: 600; | ||
} | ||
div { | ||
cursor: pointer; | ||
} | ||
.toggleWrapper { | ||
display: grid; | ||
grid-template-columns: 1fr 1fr; | ||
width: min-content; | ||
border: 3px; | ||
border-color: #08e5ff; | ||
border-style: solid; | ||
border-radius: 0.5rem; | ||
overflow: hidden; | ||
} | ||
.viewToggle { | ||
padding: 0 0.2rem; | ||
color: #008190; | ||
} | ||
.active { | ||
background-color: #08e5ff; | ||
color: #232331; | ||
} | ||
} | ||
|
||
@media (max-width: 400px) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<template lang="pug"> | ||
tr.tableHead | ||
th.tableHead--title {{title}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Due to this, i realised myself that we apply BEM wrong? Did i always do that :D ? It's There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess? I haven't touched CSS at all, I'll leave the BEM changes up to you |
||
th.tableHead--description {{desc}} | ||
th.tableHead--links {{url}} | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: ["title", "desc", "url"], | ||
}; | ||
</script> | ||
|
||
|
||
<style lang="scss" scoped> | ||
.tableHead { | ||
background: #2d3748; | ||
padding: 0.25rem; | ||
transition: 0.2s ease-in-out; | ||
width: 1fr; | ||
display: grid; | ||
grid-template-columns: minmax(150px, 2fr) 8fr 125px; | ||
|
||
&--title { | ||
color: #008190; | ||
} | ||
|
||
&--description { | ||
color: #008190; | ||
line-height: 1.3; | ||
} | ||
|
||
&--links { | ||
cursor: pointer; | ||
color: #008190; | ||
} | ||
} | ||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<template lang="pug"> | ||
tr.tableRow(:class="{ rowActive: isActive }") | ||
td.tableRow--title {{resource.title}} | ||
td.tableRow--description {{resource.desc}} | ||
td.tableRow--links | ||
tr | ||
td | ||
a.tableRow--reference(@click='createCopyUrl(resource)') Copy | ||
td | ||
a.tableRow--target(:href="resource.url" :target='resource.title' rel='noreferrer') Open | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: ['resource', 'isActive', 'createCopyUrl'], | ||
}; | ||
</script> | ||
|
||
|
||
<style lang="scss" scoped> | ||
.rowActive { | ||
box-shadow:inset 0px 0px 0px 3px #08e5ff; | ||
} | ||
.tableRow { | ||
background: #2d3748; | ||
padding: 0.25rem; | ||
transition: 0.2s ease-in-out; | ||
width: 1fr; | ||
display: grid; | ||
grid-template-columns: minmax(150px, 2fr) 8fr 125px; | ||
|
||
&--title { | ||
color: white; | ||
} | ||
|
||
&--description { | ||
color: #008190; | ||
line-height: 1.3; | ||
margin-right: 10px; | ||
} | ||
|
||
&--links { | ||
cursor: pointer; | ||
|
||
tr { | ||
width: 100%; | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
|
||
img { | ||
width: 1rem; | ||
margin-left: 0.5rem; | ||
} | ||
|
||
&:hover::before { | ||
opacity: 0.5; | ||
} | ||
} | ||
|
||
&--reference { | ||
&::before { | ||
position: absolute; | ||
height: 0.9rem; | ||
width: 0.9rem; | ||
margin-left: -1.15rem; | ||
margin-top: -0.1rem; | ||
content: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iIzA4ZTVmZiI+PHBhdGggZD0iTSA0IDIgQyAzLjkwNSAyIDMuODE1NjA5NCAyLjAxNDM0MzggMy43MjQ2MDk0IDIuMDI3MzQzOCBDIDMuNDM0NjA5NCAyLjE0MzM0MzggMy4xMzk3MDMxIDIuMjU3MDkzOCAyLjg0NTcwMzEgMi4zNzEwOTM4IEMgMi4zMzQ3MDMxIDIuNzMzMDkzOCAyIDMuMzI2I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IDggMTcuODAxIDggMTcgQyA4IDE2LjE5OSA4LjMxMjkwNjIgMTUuNDQ1OTA2IDguODc4OTA2MiAxNC44Nzg5MDYgTCAxMC45NzI2NTYgMTIuNzg1MTU2IEwgMTIuMzg2NzE5IDE0LjE5OTIxOSBMIDE0LjM2OTE0MSAxMi4yMTY3OTcgTCAxMi45NTUwNzggMTAuODAyNzM0IEwgMTQuODc4OTA2IDguODc4OTA2MiBDIDE1LjQ2MzkwNiA4LjI5MzkwNjIgMTYuMjMyIDguMDAxOTUzMSAxNyA4LjAwMTk1MzEgeiBNIDEyLjM3MzA0NyAxNC4yMTI4OTEgTCAxMC4yOTI5NjkgMTYuMjkyOTY5IEMgMTAuMTAzOTY5IDE2LjQ4MTk2OSAxMCAxNi43MzMgMTAgMTcgQyAxMCAxNy4yNjcgMTAuMTAzOTY5IDE3LjUxODAzMSAxMC4yOTI5NjkgMTcuNzA3MDMxIEMgMTAuNjcxOTY5IDE4LjA4NjAzMSAxMS4zMjgwMzEgMTguMDg1MDMxIDExLjcwNzAzMSAxNy43MDcwMzEgTCAxMy43ODcxMDkgMTUuNjI2OTUzIEwgMTIuMzczMDQ3IDE0LjIxMjg5MSB6IiBmaWxsPSIjMDhlNWZmIi8+PC9zdmc+Cg=="); | ||
} | ||
} | ||
&--target { | ||
&::before { | ||
position: absolute; | ||
height: 0.9rem; | ||
width: 0.9rem; | ||
margin-left: -1.15rem; | ||
margin-top: -0.1rem; | ||
content: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iIzA4ZTVmZiI+PHBhdGggc3R5bGU9ImxpbmUtaGVpZ2h0Om5vcm1hbDt0ZXh0LWluZGVudDowO3RleHQtYWxpZ246c3RhcnQ7dGV4dC1kZWNvcmF0aW9uLWxpbmU6bm9uZTt0ZXh0LWRlY29yYXRpb24tc3R5bGU6c29saWQ7dGV4dC1kZWNvcmF0aW9uLWNvbG9yOiMwMDA7dGV4dC10cmFuc2Zvcm06bm9uZTtibG9jay1wcm9ncmVzc2lvbjp0Yjtpc29sYXRpb246YXV0bzttaXgtYmxlbmQtbW9kZTpub3JtYWwiIGQ9Ik0gNSAzIEMgMy45MDY5MzcyIDMgMyAzLjkwNjkzNzIgMyA1IEwgMyAxOSBDIDMgMjAuMDkzMDYzIDMuOTA2OTM3MiAyMSA1IDIxIEwgMTkgMjEgQyAyMC4wOTMwNjMgMjEgMjEgMjAuMDkzMDYzIDIxIDE5IEwgMjEgMTIgTCAxOSAxMiBMIDE5IDE5IEwgNSAxOSBMIDUgNSBMIDEyIDUgTCAxMiAzIEwgNSAzIHogTSAxNCAzIEwgMTQgNSBMIDE3LjU4NTkzOCA1IEwgOC4yOTI5Njg4IDE0LjI5Mjk2OSBMIDkuNzA3MDMxMiAxNS43MDcwMzEgTCAxOSA2LjQxNDA2MjUgTCAxOSAxMCBMIDIxIDEwIEwgMjEgMyBMIDE0IDMgeiIgZm9udC13ZWlnaHQ9IjQwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIHdoaXRlLXNwYWNlPSJub3JtYWwiIG92ZXJmbG93PSJ2aXNpYmxlIiBmaWxsPSIjMDhlNWZmIi8+PC9zdmc+Cg=="); | ||
} | ||
} | ||
} | ||
</style> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of doing
.cardActive
we could continue with sass and do:I'd prefer it that way, to keep a consistent structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done