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

chore: remove last of the antd Row components #19489

Merged
merged 3 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
11 changes: 6 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ module.exports = {
importNames: ['Alert'],
message: 'Please use LemonBanner from @posthog/lemon-ui instead.',
},
{
name: 'antd',
importNames: ['Row'],
message:
'use flex utility classes instead, e.g. <Row align="middle"> could be <div className="flex items-center">',
},
],
},
],
Expand All @@ -141,11 +147,6 @@ module.exports = {
'warn',
{
forbid: [
{
element: 'Row',
message:
'use flex utility classes instead, e.g. <Row align="middle"> could be <div className="flex items-center">',
},
{
element: 'Col',
message: 'use flex utility classes instead - most of the time can simply be a plain <div>',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

.funnel-correlation-header {
display: flex;
flex-wrap: wrap;
place-content: space-between space-between;
align-items: center;
align-self: stretch;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import './FunnelCorrelationTable.scss'

import { IconInfo } from '@posthog/icons'
import { LemonButton, LemonCheckbox } from '@posthog/lemon-ui'
import { Col, ConfigProvider, Empty, Row, Table } from 'antd'
import { ConfigProvider, Empty, Table } from 'antd'
import Column from 'antd/lib/table/Column'
import { useActions, useValues } from 'kea'
import { PersonPropertySelect } from 'lib/components/PersonPropertySelect/PersonPropertySelect'
Expand Down Expand Up @@ -135,58 +135,52 @@ export function FunnelPropertyCorrelationTable(): JSX.Element | null {
return steps.length > 1 ? (
<VisibilitySensor offset={150} id={`${correlationPropKey}-properties`}>
<div className="funnel-correlation-table">
<Row className="funnel-correlation-header">
<Col className="table-header">
<div className="funnel-correlation-header">
<div className="table-header">
<IconSelectProperties style={{ marginRight: 4, opacity: 0.5, fontSize: 24 }} />
CORRELATED PROPERTIES
</Col>
<Col className="table-options">
<Row style={{ display: 'contents' }}>
<>
<p className="title">PROPERTIES </p>
<Popover
visible={isPropertiesOpen}
onClickOutside={() => setIsPropertiesOpen(false)}
overlay={
<div className="p-4">
<PersonPropertySelect
onChange={setPropertyNames}
selectedProperties={
propertyNames.length === 1 && propertyNames[0] === '$all'
? []
: propertyNames
}
addText="Add properties"
/>
<br />
{propertyNames.length === 1 && propertyNames[0] === '$all' ? (
<>All properties selected</>
) : (
<LemonButton
size="small"
type="primary"
onClick={() => setAllProperties()}
>
Select all properties
</LemonButton>
)}
</div>
}
>
<LemonButton size="small" onClick={() => setIsPropertiesOpen(true)}>
</div>
<div className="table-options">
<div className="flex">
<p className="title">PROPERTIES </p>
<Popover
visible={isPropertiesOpen}
onClickOutside={() => setIsPropertiesOpen(false)}
overlay={
<div className="p-4">
<PersonPropertySelect
onChange={setPropertyNames}
selectedProperties={
propertyNames.length === 1 && propertyNames[0] === '$all'
? []
: propertyNames
}
addText="Add properties"
/>
<br />
{propertyNames.length === 1 && propertyNames[0] === '$all' ? (
<>All properties selected</>
) : (
<>
{propertyNames.length} propert{propertyNames.length === 1 ? 'y' : 'ies'}{' '}
selected
</>
<LemonButton size="small" type="primary" onClick={() => setAllProperties()}>
Select all properties
</LemonButton>
)}
</LemonButton>
</Popover>
</>
</Row>
<Row style={{ display: 'contents' }}>
</div>
}
>
<LemonButton size="small" onClick={() => setIsPropertiesOpen(true)}>
{propertyNames.length === 1 && propertyNames[0] === '$all' ? (
<>All properties selected</>
) : (
<>
{propertyNames.length} propert{propertyNames.length === 1 ? 'y' : 'ies'}{' '}
selected
</>
)}
</LemonButton>
</Popover>
</div>
<div className="flex">
<p className="title ml-2">CORRELATION</p>
<div className="flex">
<LemonCheckbox
Expand All @@ -204,9 +198,9 @@ export function FunnelPropertyCorrelationTable(): JSX.Element | null {
bordered
/>
</div>
</Row>
</Col>
</Row>
</div>
</div>
</div>
<ConfigProvider
renderEmpty={() =>
loadedPropertyCorrelationsTableOnce ? (
Expand Down
Loading