Skip to content

Commit 51833f5

Browse files
committed
added headers, show section on md screen
1 parent fd8551b commit 51833f5

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

frontend/src/components/app/settings/SectionHeader.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
2-
<div class="md:hidden flex max-w-sm justify-between items-center w-full my-4 lg:mb-0">
3-
<h1 class="text-3xl md:hidden text-gray-matcha capitalize">{{ name }}</h1>
2+
<div class="flex max-w-sm justify-between items-center w-full my-4">
3+
<h1 class="text-3xl text-gray-matcha capitalize">{{ name }}</h1>
44
<div class="md:hidden sort-button rounded-md text-lg w-12">
55
<h1 class="noSelect">←</h1>
66
</div>

frontend/src/views/app/Settings.vue

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!-- eslint-disable max-len -->
33
<div>
44
<NavBar class="px-4 sm:px-16 lg:px-32" v-bind:currentRoute="'Settings'"></NavBar>
5-
<div class="w-full md:w-auto md:mx-16 lg:mx-32 relative md:flex items-start h-auto md:mb-16 lg:mb-32">
5+
<div class="w-full md:w-auto md:mx-16 lg:mx-32 relative md:flex items-start h-auto md:mb-16">
66
<section class="w-full md:max-w-xss md:shadow-md md:rounded-md">
77
<div class="w-full md:hidden h-1 bg-white-matcha"></div>
88
<div class="text-wrap bg-white-matcha recommendation-card w-full md:rounded-t-md"
@@ -44,9 +44,11 @@
4444
v-bind:type="'password'"
4545
v-bind:currentValuePassed="''"></AccountInput>
4646
</section>
47-
<section v-if="getShow === 'profile'" class="overflow-scroll profile-section flex flex-col items-start z-10 absolute bg-white-matcha w-full top-0 left-0 md:ml-4 md:relative md:shadow-md md:rounded-md">
48-
<SectionHeader class="mx-auto" v-bind:name="'profile'" v-on:click.native="closeSetting()"></SectionHeader>
49-
<div class="py-8 px-8 w-full">
47+
<section v-if="getShow === 'profile'" class="flex flex-col items-start z-10 absolute bg-white-matcha w-full top-0 left-0 md:ml-4 md:relative md:shadow-md md:rounded-md">
48+
<div class="px-8 w-full">
49+
<SectionHeader class="mx-auto" v-bind:name="'profile'" v-on:click.native="closeSetting()"></SectionHeader>
50+
</div>
51+
<div class="pb-8 pt-4 px-8 w-full">
5052
<div class="mx-auto max-w-sm">
5153
<h1 class="inline-block mr-4 text-gray-matcha">I am</h1>
5254
<DropdownDisplayChoice
@@ -245,8 +247,17 @@ export default {
245247
}
246248
return this.$store.getters.getLoggedInUser.images[0].link;
247249
},
250+
openSectionOnMd(e) {
251+
if (e.target.innerWidth >= 768 && this.show === '') {
252+
this.show = 'profile';
253+
}
254+
},
248255
},
249256
beforeMount() {
257+
window.addEventListener('resize', this.openSectionOnMd);
258+
if (window.innerWidth >= 768) {
259+
this.show = 'profile';
260+
}
250261
console.log(this.$store.getters.getLoggedInUser);
251262
const tags = this.$store.getters.getLoggedInUser.tags;
252263
for (let i = 0; i < tags.length; i += 1) {
@@ -268,8 +279,4 @@ export default {
268279
height: 10rem;
269280
}
270281
}
271-
272-
.profile-section {
273-
height: 34rem;
274-
}
275282
</style>

0 commit comments

Comments
 (0)