Skip to content

Commit

Permalink
Style device list item
Browse files Browse the repository at this point in the history
  • Loading branch information
pkong-ds committed May 24, 2024
1 parent fa21245 commit 9dc49dc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
9 changes: 4 additions & 5 deletions src/pages/type/[type].astro
Original file line number Diff line number Diff line change
Expand Up @@ -129,26 +129,24 @@ const allDeviceType: DeviceType = DEVICE_MANAGER.allDeviceTypes;
</ul>
</section>
<section class="select-device">
<header class="select-device__header">
<h2 class="select-device__heading">SELECT DEVICE</h2>
</header>
<ul class="device-section-list">
{
Object.keys(brandDeviceList).map((b: string) => {
const brand = BrandEnum.parse(b);
const devices = brandDeviceList[brand];
console.log(devices)
if (devices == null || devices.length === 0) {
return <></>
}
return (
<li class="device-section-list__item" data-device-id={b}>
<section id={b} class="device-section">
<h3 class="device-section__device-name">{b}</h3>
<h3 class="device-section__brand-name">{brand.toUpperCase()}</h3>
{
<ul class="device-grid-list">
{/* FIXME: Remove background color for debugging */}
{devices.map((deviceDetail: Device) => (
<div class="device-grid-container">
<h3 class="device-grid-container-header">{deviceDetail.name}</p>
<li
class="device-grid"
style={{ backgroundColor: deviceDetail.color.hexcode }}
Expand Down Expand Up @@ -196,6 +194,7 @@ const allDeviceType: DeviceType = DEVICE_MANAGER.allDeviceTypes;
</div>
</a>
</li>
</div>
))}
</ul>
}
Expand Down
27 changes: 21 additions & 6 deletions src/styles/device.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
}

.select-device {
padding: 50px 20px 40px 20px;
padding: 50px 20px 50px 20px;
background-color: rgba(0, 0, 0, 0.06);
}
@media (min-width: 992px) {
Expand Down Expand Up @@ -339,7 +339,7 @@

.device-section-list {
list-style: none;
margin: 40px 0 0 0;
margin: 0 0 0 0;
padding: 0;
}

Expand All @@ -351,14 +351,19 @@
margin: 10px 0 0 0;
}

.device-section-list__item {
margin-bottom: 100px;
}

.device-section {
scroll-margin-top: 80px;
}

.device-section__device-name {
.device-section__brand-name {
color: var(--gray-1);
font-size: 18px;
margin: 0;
font-size: 24px;
font-weight: 700;
margin: 0 0 30px 0;
}

.device-grid-list {
Expand All @@ -369,11 +374,21 @@
padding: 0;
}

.device-grid-container {
margin: 20px 0 0 10px;
}

.device-grid-container-header {
color: var(--gray-1);
font-size: 18px;
font-weight: 600;
margin: 0 0 20px 0;
}

.device-grid {
position: relative;
height: 160px;
width: 160px;
margin: 10px 0 0 10px;
background-color: var(--white);
border: 1px solid var(--gray-5);
box-sizing: border-box;
Expand Down

0 comments on commit 9dc49dc

Please sign in to comment.