Skip to content

Commit

Permalink
Merge branch 'cent-app/synpress-testing-setup' of github.com:centrifu…
Browse files Browse the repository at this point in the history
…ge/apps into cent-app/synpress-testing-setup
  • Loading branch information
sophialittlejohn committed Nov 28, 2023
2 parents c2ebf14 + 6adb6ef commit cd5ff3b
Show file tree
Hide file tree
Showing 38 changed files with 1,785 additions and 765 deletions.
11 changes: 3 additions & 8 deletions centrifuge-app/src/components/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const DataTable = <T extends Record<string, any>>({
minWidth={scrollWidth > 0 ? scrollWidth : 'auto'}
>
{showHeader && (
<HeaderRow templateColumns={templateColumns}>
<HeaderRow>
{columns.map((col, i) => (
<HeaderCol key={i} align={col?.align}>
<Text variant="body3">
Expand All @@ -134,7 +134,6 @@ export const DataTable = <T extends Record<string, any>>({
to={onRowClicked && (() => onRowClicked(row))}
key={keyField ? row[keyField] : i}
tabIndex={onRowClicked ? 0 : undefined}
templateColumns={templateColumns}
>
{columns.map((col, index) => (
<DataCol variant="body2" align={col?.align} key={index}>
Expand All @@ -145,7 +144,7 @@ export const DataTable = <T extends Record<string, any>>({
))}
{/* summary row is not included in sorting */}
{summary && (
<DataRow templateColumns={templateColumns}>
<DataRow>
{columns.map((col, i) => (
<DataCol variant="body2" key={`${col.sortKey}-${i}`} align={col?.align}>
{col.cell(summary, i)}
Expand All @@ -164,12 +163,8 @@ export const DataTable = <T extends Record<string, any>>({

const TableGrid = styled(Grid)``

const Row = styled('div')<any>`
const Row = styled('div')`
display: grid;
// Fallback for browsers that don't support subgrid
// Tables will look a bit wonky in those browsers
// TODO: Remove when browser support is sufficient
grid-template-columns: ${(props) => props.templateColumns};
grid-template-columns: subgrid;
grid-column: start / end;
box-shadow: ${({ theme }) => `-1px 0 0 0 ${theme.colors.borderSecondary}, 1px 0 0 0 ${theme.colors.borderSecondary}`};
Expand Down
5 changes: 5 additions & 0 deletions centrifuge-app/src/components/DebugFlags/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export type Key =
| 'showLiquidityPoolsOptions'
| 'showPrime'
| 'poolCreationType'
| 'podAdminSeed'

export const flagsConfig: Record<Key, DebugFlagConfig> = {
address: {
Expand Down Expand Up @@ -157,4 +158,8 @@ export const flagsConfig: Record<Key, DebugFlagConfig> = {
notePreimage: 'notePreimage',
},
},
podAdminSeed: {
type: 'text',
default: '//Eve',
},
}
4 changes: 3 additions & 1 deletion centrifuge-app/src/components/LayoutBase/BasePadding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ type BaseSectionProps = BoxProps & {
children: React.ReactNode
}

export const BASE_PADDING = [2, 2, 3, 3, 5]

export function BasePadding({ children, ...boxProps }: BaseSectionProps) {
return (
<Stack pt={4} pb={4} px={[2, 2, 3, 3, 5]} {...boxProps}>
<Stack pt={4} pb={4} px={BASE_PADDING} {...boxProps}>
{children}
</Stack>
)
Expand Down
5 changes: 1 addition & 4 deletions centrifuge-app/src/components/LayoutBase/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { LoadBoundary } from '../LoadBoundary'
import { LogoLink } from '../LogoLink'
import { Menu } from '../Menu'
import { OnboardingStatus } from '../OnboardingStatus'
import { SideDrawerProps } from '../SideDrawer'
import { BasePadding } from './BasePadding'
import {
FooterContainer,
Expand All @@ -23,10 +22,9 @@ import {

type LayoutBaseProps = {
children?: React.ReactNode
sideDrawer?: React.ReactElement<SideDrawerProps>
}

export function LayoutBase({ children, sideDrawer }: LayoutBaseProps) {
export function LayoutBase({ children }: LayoutBaseProps) {
return (
<Root>
<Inner>
Expand Down Expand Up @@ -58,7 +56,6 @@ export function LayoutBase({ children, sideDrawer }: LayoutBaseProps) {
<Footer />
</FooterContainer>
</Inner>
<LoadBoundary>{sideDrawer}</LoadBoundary>
</Root>
)
}
Expand Down
4 changes: 3 additions & 1 deletion centrifuge-app/src/components/Portfolio/InvestedTokens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const columns: Column[] = [
cell: (token: Row) => {
return <TokenWithIcon {...token} />
},
width: '2fr',
},
{
header: 'Token price',
Expand All @@ -50,6 +49,7 @@ const columns: Column[] = [
</Text>
)
},
align: 'left',
},
{
header: <SortableTableHeader label="Position" />,
Expand All @@ -61,6 +61,7 @@ const columns: Column[] = [
)
},
sortKey: 'position',
align: 'left',
},
{
header: <SortableTableHeader label="Market value" />,
Expand All @@ -72,6 +73,7 @@ const columns: Column[] = [
)
},
sortKey: 'marketValue',
align: 'left',
},
{
align: 'left',
Expand Down
4 changes: 2 additions & 2 deletions centrifuge-app/src/components/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ export function prefetchRoute(to: string | LinkProps['to']) {
function Routes() {
return (
<Switch>
{routes.map((route) => (
<Route {...route} />
{routes.map((route, i) => (
<Route {...route} key={i} />
))}
</Switch>
)
Expand Down
63 changes: 0 additions & 63 deletions centrifuge-app/src/components/SideDrawer.tsx

This file was deleted.

Loading

0 comments on commit cd5ff3b

Please sign in to comment.