Skip to content

Commit

Permalink
refactoring base widget
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita-Polyakov committed Feb 29, 2024
1 parent 732ecf3 commit c1c108c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<base-widget v-loading="parentLoading" class="swap-widget" :title="t('exchange.Swap')">
<base-widget v-loading="parentLoading" class="swap-widget" :title="t('exchange.Swap')" primary-title>
<template #filters>
<swap-status-action-badge>
<template #label>{{ t('marketText') }}:</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<s-card :class="['base-widget', { delimeter }]" border-radius="small" shadow="always" size="big" primary>
<template #header v-if="hasHeader">
<div class="base-widget-block base-widget-header">
<div class="base-widget-block base-widget-title">
<div :class="['base-widget-block', 'base-widget-title', { primary: primaryTitle }]">
<slot name="title">
<h4 v-if="title">{{ title }}</h4>
<span v-if="title">{{ title }}</span>
<s-tooltip v-if="tooltip" border-radius="mini" :content="tooltip">
<s-icon name="info-16" size="14px" />
</s-tooltip>
Expand Down Expand Up @@ -36,6 +36,7 @@ export default class BaseWidget extends Vue {
@Prop({ default: '', type: String }) readonly tooltip!: string;
@Prop({ default: false, type: Boolean }) readonly delimeter!: boolean;
@Prop({ default: false, type: Boolean }) readonly extensive!: boolean;
@Prop({ default: false, type: Boolean }) readonly primaryTitle!: boolean;
get hasHeader(): boolean {
return !!this.title || !!this.$slots.title;
Expand Down Expand Up @@ -83,15 +84,21 @@ $left: $inner-spacing-medium;
flex-flow: row wrap;
justify-content: space-between;
padding: $top $left $between;
font-size: var(--s-font-size-medium);
font-weight: 500;
line-height: var(--s-line-height-medium);
}
&-title {
flex: 1;
flex-flow: row nowrap;
font-size: var(--s-font-size-medium);
font-weight: 500;
line-height: var(--s-line-height-medium);
&.primary {
font-size: var(--s-font-size-large);
font-weight: 300;
line-height: var(--s-line-height-reset);
}
}
&-filters {
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions src/consts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export enum Components {
X1Dialog = 'pages/X1/X1Dialog',
X1History = 'pages/X1/X1History',
// Swap Page
SwapFormWidget = 'pages/Swap/FormWidget',
SwapFormWidget = 'pages/Swap/Form/Widget',
SwapChartWidget = 'pages/Swap/ChartWidget',
SwapTransactionsWidget = 'pages/Swap/TransactionsWidget',
SwapConfirm = 'pages/Swap/Confirm',
Expand Down Expand Up @@ -249,9 +249,9 @@ export enum Components {
PoolInfo = 'shared/PoolInfo',
StatusBadge = 'shared/StatusBadge',
// Shared Widgets
BaseWidget = 'shared/Widget/BaseWidget',
IFrameWidget = 'shared/Widget/IFrameWidget',
PriceChartWidget = 'shared/Widget/PriceChartWidget',
BaseWidget = 'shared/Widget/Base',
IFrameWidget = 'shared/Widget/IFrame',
PriceChartWidget = 'shared/Widget/PriceChart',
// Shared Buttons
SortButton = 'shared/Button/SortButton',
SvgIconButton = 'shared/Button/SvgIconButton/SvgIconButton',
Expand Down

0 comments on commit c1c108c

Please sign in to comment.