diff --git a/packages/page-calendar/src/index.tsx b/packages/page-calendar/src/index.tsx
index 3ac79aa3d8..1ec2a837b0 100644
--- a/packages/page-calendar/src/index.tsx
+++ b/packages/page-calendar/src/index.tsx
@@ -189,6 +189,7 @@ export default React.memo(styled(CalendarApp)`
h1 {
align-items: center;
+ border-bottom: 0.25rem solid var(--bg-page);
display: flex;
justify-content: space-between;
padding: 0.5rem 0.5rem 0 1rem;
diff --git a/packages/page-parachains/src/Auctions/Auction.tsx b/packages/page-parachains/src/Auctions/Auction.tsx
index b5f235fbcf..652ab0f704 100644
--- a/packages/page-parachains/src/Auctions/Auction.tsx
+++ b/packages/page-parachains/src/Auctions/Auction.tsx
@@ -37,20 +37,22 @@ function Auction ({ auctionInfo, className, winningData }: Props): React.ReactEl
)
}
header={headerRef.current}
+ noBodyTag
>
- {auctionInfo && winningData?.map(({ blockNumber, winners }, round) =>
- winners.map((value, index) => (
-
- ))
- )}
+ {auctionInfo && winningData?.map(({ blockNumber, winners }, round) => (
+
+ {winners.map((value, index) => (
+
+ ))}
+
+ ))}
);
}
diff --git a/packages/react-components/src/Table/Body.tsx b/packages/react-components/src/Table/Body.tsx
index d8dfe9dc1a..bd2d2a0dfa 100644
--- a/packages/react-components/src/Table/Body.tsx
+++ b/packages/react-components/src/Table/Body.tsx
@@ -13,223 +13,29 @@ interface Props {
className?: string;
empty?: React.ReactNode | false;
emptySpinner?: React.ReactNode;
+ noBodyTag?: boolean;
}
-function Body ({ children, className = '', empty, emptySpinner }: Props): React.ReactElement {
- return (
-
- {children || (
- | {
- isString(empty)
- ? {empty}
- : empty ||
- } |
- )}
-
- );
+function Body ({ children, className = '', empty, emptySpinner, noBodyTag }: Props): React.ReactElement {
+ return children
+ ? (
+ noBodyTag
+ ? <>{children}>
+ : {children}
+ )
+ : (
+
+
+ | {
+ isString(empty)
+ ? {empty}
+ : empty ||
+ } |
+
+
+ );
}
export default React.memo(styled(Body)`
- position: relative;
- td {
- border-bottom: 1px solid var(--border-table);
- padding: 0.5rem 1rem;
- text-align: left;
- vertical-align: middle;
-
- &:first-child {
- border-left: 1px solid var(--border-table);
- }
-
- &:last-child {
- border-right: 1px solid var(--border-table);
- }
-
- label {
- display: block !important;
- white-space: nowrap;
- }
-
- div.empty {
- opacity: 0.6;
- padding: 0.25rem;
- }
-
- .ui--Spinner {
- margin: 0 auto;
-
- .text {
- margin-bottom: 0;
- }
- }
-
- &.address {
- min-width: 11rem;
- overflow-x: hidden;
- }
-
- &.badge {
- padding: 0.5rem;
- }
-
- &.button {
- padding: 0.25rem 0.5rem;
- text-align: right;
- white-space: nowrap;
-
- > * {
- vertical-align: middle;
- }
-
- .ui--Toggle {
- display: inline-block;
- white-space: nowrap;
-
- label {
- display: inline-block !important;
- }
- }
- }
-
- &.combined {
- border-top-width: 0;
- }
-
- &.expand {
- &:not(.left) {
- text-align: right;
- }
-
- .ui--Expander+.ui--Expander {
- margin-top: 0.375rem;
- }
- }
-
- &.hash {
- font: var(--font-mono);
- }
-
- &.links {
- padding: 0.5rem 0.75rem;
- text-align: center;
- width: 0;
- }
-
- &.no-pad-left {
- padding-left: 0.125rem;
- }
-
- &.no-pad-right {
- padding-right: 0.125rem;
- }
-
- &.number {
- text-align: right;
- }
-
- &.relative {
- position: relative;
- }
-
- &.overflow {
- max-width: 0;
- overflow: hidden;
- text-overflow: ellipsis;
- }
-
- &.start {
- text-align: left;
- }
-
- &.together {
- white-space: nowrap;
- }
-
- &.top {
- vertical-align: top;
- }
-
- &.middle {
- text-align: center;
- }
-
- &.mini {
- padding: 0 !important;
- width: fit-content;
- white-space: normal;
-
- > div {
- margin-right: 0.75rem;
- max-width: 3.8rem;
- min-width: 3.8rem;
- }
- }
-
- &.upper {
- text-transform: uppercase;
- }
-
- &.favorite .ui--Icon.isSelected {
- color: darkorange;
- }
-
- .ui--Button-Group .ui--Button:not(.isToplevel) {
- margin: 0;
- }
- }
-
- tr {
- &:nth-child(odd):not(.isEven),
- &:nth-child(even).isOdd {
- background: var(--bg-table);
- }
-
- &:first-child {
- td:first-child {
- border-top-left-radius: 0.25rem;
- }
-
- td:last-child {
- border-top-right-radius: 0.25rem;
- }
- }
-
- &:last-child {
- td {
- border-bottom: 1px solid var(--border-table);
-
- &:first-child {
- border-bottom-left-radius: 0.25rem;
- }
-
- :last-child {
- border-bottom-right-radius: 0.25rem;
- }
- }
- }
-
- &.transparent {
- background: transparent;
- }
-
- &.noBorder td {
- border-bottom: 1px solid transparent;
- padding-bottom: 0 !important;
- }
-
- .ui--Button-Group {
- margin: 0;
- }
-
- .ui--Button:not(.isIcon):not(:hover) {
- background: transparent !important;
- box-shadow: none !important;
- }
-
- .ui.toggle.checkbox input:checked~.box:before,
- .ui.toggle.checkbox input:checked~label:before {
- background-color: #eee !important;
- }
- }
`);
diff --git a/packages/react-components/src/Table/Head.tsx b/packages/react-components/src/Table/Head.tsx
index da31310200..6463920a43 100644
--- a/packages/react-components/src/Table/Head.tsx
+++ b/packages/react-components/src/Table/Head.tsx
@@ -63,9 +63,9 @@ export default React.memo(styled(Head)`
th {
font: var(--font-sans);
font-weight: var(--font-weight-normal);
- padding: 0.5rem 1rem 0.25rem;
+ padding: 0.375rem 1rem;
text-align: right;
- vertical-align: baseline;
+ vertical-align: middle;
white-space: nowrap;
h1, h2 {
@@ -73,6 +73,9 @@ export default React.memo(styled(Head)`
}
h1 {
+ display: table-cell;
+ vertical-align: middle;
+
.ui--Icon {
font-size: 1rem;
margin-right: 0.5rem;
diff --git a/packages/react-components/src/Table/index.tsx b/packages/react-components/src/Table/index.tsx
index 23db02125b..c89a297177 100644
--- a/packages/react-components/src/Table/index.tsx
+++ b/packages/react-components/src/Table/index.tsx
@@ -18,9 +18,10 @@ interface TableProps {
header?: [React.ReactNode?, string?, number?, (() => void)?][];
isFixed?: boolean;
legend?: React.ReactNode;
+ noBodyTag?: boolean;
}
-function extractKids (children: React.ReactNode): [boolean, React.ReactNode] {
+function extractBodyChildren (children: React.ReactNode): [boolean, React.ReactNode] {
if (!Array.isArray(children)) {
return [!children, children];
}
@@ -31,8 +32,8 @@ function extractKids (children: React.ReactNode): [boolean, React.ReactNode] {
return [isEmpty, isEmpty ? null : kids];
}
-function Table ({ children, className = '', empty, emptySpinner, filter, footer, header, isFixed, legend }: TableProps): React.ReactElement {
- const [isEmpty, kids] = extractKids(children);
+function Table ({ children, className = '', empty, emptySpinner, filter, footer, header, isFixed, legend, noBodyTag }: TableProps): React.ReactElement {
+ const [isEmpty, bodyChildren] = extractBodyChildren(children);
return (
@@ -46,8 +47,9 @@ function Table ({ children, className = '', empty, emptySpinner, filter, footer,
- {kids}
+ {bodyChildren}
* {
+ vertical-align: middle;
+ }
+
+ .ui--Toggle {
+ display: inline-block;
+ white-space: nowrap;
+
+ label {
+ display: inline-block !important;
+ }
+ }
+ }
+
+ &.combined {
+ border-top-width: 0;
+ }
+
+ &.expand {
+ &:not(.left) {
+ text-align: right;
+ }
+
+ .ui--Expander+.ui--Expander {
+ margin-top: 0.375rem;
+ }
+ }
+
+ &.hash {
+ font: var(--font-mono);
+ }
+
+ &.links {
+ padding: 0.5rem 0.75rem;
+ text-align: center;
+ width: 0;
+ }
+
+ &.no-pad-left {
+ padding-left: 0.125rem;
+ }
+
+ &.no-pad-right {
+ padding-right: 0.125rem;
+ }
+
+ &.number {
+ text-align: right;
+ }
+
+ &.relative {
+ position: relative;
+ }
+
+ &.overflow {
+ max-width: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+
+ &.start {
+ text-align: left;
+ }
+
+ &.together {
+ white-space: nowrap;
+ }
+
+ &.top {
+ vertical-align: top;
+ }
+
+ &.middle {
+ text-align: center;
+ }
+
+ &.mini {
+ padding: 0 !important;
+ width: fit-content;
+ white-space: normal;
+
+ > div {
+ margin-right: 0.75rem;
+ max-width: 3.8rem;
+ min-width: 3.8rem;
+ }
+ }
+
+ &.upper {
+ text-transform: uppercase;
+ }
+
+ &.favorite .ui--Icon.isSelected {
+ color: darkorange;
+ }
+
+ .ui--Button-Group .ui--Button:not(.isToplevel) {
+ margin: 0;
+ }
+ }
+
+ tr {
+ &:nth-child(odd):not(.isEven),
+ &:nth-child(even).isOdd {
+ background: var(--bg-table);
+ }
+
+ &:first-child {
+ td {
+ border-top: 0.25rem solid var(--bg-page);
+ }
+
+ td:first-child {
+ border-top-left-radius: 0.25rem;
+ }
+
+ td:last-child {
+ border-top-right-radius: 0.25rem;
+ }
+ }
+
+ &:last-child {
+ td {
+ border-bottom: 1px solid var(--border-table);
+
+ &:first-child {
+ border-bottom-left-radius: 0.25rem;
+ }
+
+ :last-child {
+ border-bottom-right-radius: 0.25rem;
+ }
+ }
+ }
+
+ &.transparent {
+ background: transparent;
+ }
+
+ &.noBorder td {
+ border-bottom: 1px solid transparent;
+ padding-bottom: 0 !important;
+ }
+
+ .ui--Button-Group {
+ margin: 0;
+ }
+
+ .ui--Button:not(.isIcon):not(:hover) {
+ background: transparent !important;
+ box-shadow: none !important;
+ }
+
+ .ui.toggle.checkbox input:checked~.box:before,
+ .ui.toggle.checkbox input:checked~label:before {
+ background-color: #eee !important;
+ }
+ }
+ }
`);