Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NeoModalHead to tailwindcss #8516

Merged
merged 4 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion components/common/shoppingCart/ShoppingCartModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
data-testid="shopping-cart-modal-container">
<NeoModalHead
:title="$t('shoppingCart.title')"
data-testid="shopping-cart-modal"
@close="closeShoppingCart(ModalCloseType.BACK)" />
<div
v-if="numberOfItems"
Expand Down
30 changes: 0 additions & 30 deletions libs/ui/src/components/NeoModalHead/NeoModalHead.scss

This file was deleted.

29 changes: 12 additions & 17 deletions libs/ui/src/components/NeoModalHead/NeoModalHead.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<template>
<header v-if="isMobile" class="modal-card-head">
<div class="modal-card-title">
<a class="has-text-inherit" @click.stop="emit('close')">
<NeoIcon icon="chevron-left" />
</a>
{{ title }}
</div>
<header
class="flex lg:hidden py-0 px-tw-5 min-h-[64px] items-center border-b border-border-color bg-background-color-inverse">
<button
type="button"
class="w-full h-full text-left cursor-pointer p-0 bg-transparent text-base/normal text-text-color-inverse"
data-testid="modal-close-button"
@click="emit('close')">
<NeoIcon icon="chevron-left" />
<span>{{ title }}</span>
</button>
</header>
<header
v-else
class="modal-card-head is-flex is-justify-content-space-between border-bottom">
<span class="modal-card-title is-size-6 has-text-weight-bold">
class="hidden lg:flex py-4 px-tw-8 justify-between items-center border-b border-border-color bg-background-color">
<span class="text-base font-bold">
{{ title }}
</span>
<NeoButton
Expand All @@ -25,18 +27,11 @@
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { NeoButton, NeoIcon } from '@kodadot1/brick'

defineProps<{
title: string
}>()

const isMobile = ref(window.innerWidth < 1024)

const emit = defineEmits(['close'])
</script>

<style lang="scss" scoped>
@import './NeoModalHead.scss';
</style>
3 changes: 3 additions & 0 deletions libs/ui/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ module.exports = {
'icon-spin':
'icon-spin infinite linear var(--oruga-icon-spin-duration, 1.5s)',
},
// TODO: remove it after removing bulma
padding: {
'tw-5': '1.25rem',
'tw-8': '2rem',
'button-x': 'calc(0.75em - 1px)',
'button-y': 'calc(0.5em - 1px)',
},
Expand Down
9 changes: 7 additions & 2 deletions tests/e2e/collection.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,19 @@ test('Collection interactions', async ({ page, Commands }) => {
await page.locator('[class="infinite-scroll-item"]').nth(1).hover()
await page.getByTestId('item-add-to-cart').nth(1).click()
await page.getByTestId('navbar-button-cart').click()
await expect(page.getByTestId('shopping-cart-modal')).toBeVisible()
await expect(
page.getByTestId('shopping-cart-modal-container'),
).toBeVisible()
await expect(page.getByTestId('shopping-cart-item').nth(0)).toContainText(
COLLECTION_NAME,
)
await expect(page.getByTestId('shopping-cart-item').nth(1)).toContainText(
COLLECTION_NAME,
)
await page.getByTestId('modal-close-button').click()
await page
.getByTestId('modal-close-button')
.and(page.locator(':visible'))
.click()
})

//art view
Expand Down