Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

fix: responsive layour fixes for table, modal and form fields

Vivek R3e5a6468e7c7
diff --git a/README.md b/README.md
index 35a3a8e8..6748a3b8 100644
--- a/README.md
+++ b/README.md
@@ -51,7 +51,6 @@ Alternatively, to run a demo of listmonk, you can quickly spin up a container `d
- User auth, management, permissions
- Ability to write raw campaign logs to a target
- Analytics views and reports
-- Make Ant design UI components responsive
- Better widgets on dashboard
- Tests!
diff --git a/frontend/src/Campaign.js b/frontend/src/Campaign.js
index 582aa4e1..c2352826 100644
--- a/frontend/src/Campaign.js
+++ b/frontend/src/Campaign.js
@@ -28,8 +28,8 @@ import Delta from "quill-delta"
import "react-quill/dist/quill.snow.css"
const formItemLayout = {
- labelCol: { xs: { span: 16 }, sm: { span: 4 } },
- wrapperCol: { xs: { span: 16 }, sm: { span: 10 } }
+ labelCol: { xs: { span: 16 }, sm: { span: 10 }, md: { span: 4 } },
+ wrapperCol: { xs: { span: 16 }, sm: { span: 14 }, md: { span: 10 } }
}
class Editor extends React.PureComponent {
@@ -521,7 +521,7 @@ class TheFormDef extends React.PureComponent {
/>
)}
</Col>
- <Col span={12}>
+ <Col xs={24} sm={2}>
{this.state.sendLater &&
getFieldDecorator("send_at", {
initialValue:
@@ -656,7 +656,7 @@ class Campaign extends React.PureComponent {
return (
<section className="content campaign">
<Row>
- <Col span={16}>
+ <Col xs={24} sm={16}>
{!this.state.record.id && <h1>Create a campaign</h1>}
{this.state.record.id && (
<div>
@@ -675,7 +675,7 @@ class Campaign extends React.PureComponent {
</div>
)}
</Col>
- <Col span={8} className="right">
+ <Col xs={24} sm={8} className="right header-action-break">
{!this.state.formDisabled && !this.state.loading && (
<div>
<Button
diff --git a/frontend/src/Campaigns.js b/frontend/src/Campaigns.js
index 6e7d9480..37f4c88a 100644
--- a/frontend/src/Campaigns.js
+++ b/frontend/src/Campaigns.js
@@ -651,10 +651,10 @@ class Campaigns extends React.PureComponent {
return (
<section className="content campaigns">
<Row>
- <Col xs={12} sm={14}>
+ <Col xs={24} sm={14}>
<h1>Campaigns</h1>
</Col>
- <Col xs={12} sm={10} className="align-right">
+ <Col xs={24} sm={10} className="right header-action-break">
<Link to="/campaigns/new">
<Button type="primary" icon="plus" role="link">
New campaign
diff --git a/frontend/src/Import.js b/frontend/src/Import.js
index 4b7cc45e..360b5dec 100644
--- a/frontend/src/Import.js
+++ b/frontend/src/Import.js
@@ -101,8 +101,8 @@ class TheFormDef extends React.PureComponent {
const { getFieldDecorator } = this.props.form
const formItemLayout = {
- labelCol: { xs: { span: 16 }, sm: { span: 4 } },
- wrapperCol: { xs: { span: 16 }, sm: { span: 10 } }
+ labelCol: { sm: { span: 24 }, md: { span: 5 } },
+ wrapperCol: { sm: { span: 24 }, md: { span: 10 } }
}
const formItemTailLayout = {
@@ -163,7 +163,7 @@ class TheFormDef extends React.PureComponent {
)}
<Form.Item
{...formItemLayout}
- label="CSV column delimiter"
+ label="CSV delimiter"
extra="Default delimiter is comma"
>
{getFieldDecorator("delim", {
diff --git a/frontend/src/Layout.js b/frontend/src/Layout.js
index 2dd968e9..54b1b802 100644
--- a/frontend/src/Layout.js
+++ b/frontend/src/Layout.js
@@ -33,7 +33,7 @@ class Base extends React.Component {
componentDidMount() {
// For small screen devices collapse the menu by default.
- if (window.screen.width < 576) {
+ if (window.screen.width < 768) {
this.setState({ collapsed: true });
}
};
diff --git a/frontend/src/Lists.js b/frontend/src/Lists.js
index 372dbb96..6ee8c3d6 100644
--- a/frontend/src/Lists.js
+++ b/frontend/src/Lists.js
@@ -381,7 +381,7 @@ class Lists extends React.PureComponent {
<Col xs={12} sm={18}>
<h1>Lists ({this.props.data[cs.ModelLists].total}) </h1>
</Col>
- <Col xs={12} sm={6} className="align-right">
+ <Col xs={12} sm={6} className="right">
<Button
type="primary"
icon="plus"
diff --git a/frontend/src/Subscriber.js b/frontend/src/Subscriber.js
index 5d065fba..1f0617a3 100644
--- a/frontend/src/Subscriber.js
+++ b/frontend/src/Subscriber.js
@@ -357,7 +357,7 @@ class Subscriber extends React.PureComponent {
{this.state.record.id && (
<div>
<h1>
- <Tag
+ <Tag className="subscriber-status"
color={
tagColors.hasOwnProperty(this.state.record.status)
? tagColors[this.state.record.status]
@@ -366,7 +366,9 @@ class Subscriber extends React.PureComponent {
>
{this.state.record.status}
</Tag>{" "}
- {this.state.record.name} ({this.state.record.email})
+ <span className="subscriber-name">
+ {this.state.record.name} ({this.state.record.email})
+ </span>
</h1>
<span className="text-small text-grey">
ID {this.state.record.id} / UUID {this.state.record.uuid}
@@ -374,13 +376,13 @@ class Subscriber extends React.PureComponent {
</div>
)}
</Col>
- <Col span={2} className="right">
+ <Col span={2} className="right subscriber-export">
<Tooltip title="Export data" placement="top">
<a
role="button"
href={"/api/subscribers/" + this.state.record.id + "/export"}
>
- <Icon type="export" />
+ <Icon type="export" style={{ fontSize: "20px" }}/>
</a>
</Tooltip>
</Col>
diff --git a/frontend/src/Subscribers.js b/frontend/src/Subscribers.js
index b1855623..7b8d7715 100644
--- a/frontend/src/Subscribers.js
+++ b/frontend/src/Subscribers.js
@@ -583,10 +583,10 @@ class Subscribers extends React.PureComponent {
}
return (
- <section className="content">
+ <section className="content subscribers">
<header className="header">
<Row>
- <Col xs={12} sm={14}>
+ <Col xs={24} sm={14}>
<h1>
Subscribers
{this.props.data[cs.ModelSubscribers].total > 0 && (
@@ -597,7 +597,7 @@ class Subscribers extends React.PureComponent {
)}
</h1>
</Col>
- <Col xs={12} sm={10} className="align-right">
+ <Col xs={24} sm={10} className="right header-action-break">
<Button
type="primary"
icon="plus"
@@ -611,9 +611,9 @@ class Subscribers extends React.PureComponent {
<div className="subscriber-query">
<Row>
- <Col span={10}>
+ <Col sm={24} md={10}>
<Row>
- <Col span={15}>
+ <Row>
<label>Search subscribers</label>
<Input.Search
name="name"
@@ -621,14 +621,12 @@ class Subscribers extends React.PureComponent {
enterButton
onSearch={this.handleSearch}
/>{" "}
- </Col>
- <Col span={8} offset={1}>
- <label>&nbsp;</label>
- <br />
+ </Row>
+ <Row style={{ marginTop: "10px" }}>
<a role="button" onClick={this.handleToggleQueryForm}>
<Icon type="setting" /> Advanced
</a>
- </Col>
+ </Row>
</Row>
{this.state.queryFormVisible && (
<div className="advanced-query">
@@ -684,7 +682,7 @@ class Subscribers extends React.PureComponent {
</div>
)}
</Col>
- <Col span={14}>
+ <Col sm={24} md={{ span: 12, offset: 2 }} className="slc-subs-section">
{this.state.selectedRows.length > 0 && (
<nav className="table-options">
<p>
@@ -706,7 +704,7 @@ class Subscribers extends React.PureComponent {
</span>
)}
</p>
- <p>
+ <p class="slc-subs-actions">
<a role="button" onClick={this.handleToggleListsForm}>
<Icon type="bars" /> Manage lists
</a>
diff --git a/frontend/src/Templates.js b/frontend/src/Templates.js
index bfdb1a69..d5ad0b08 100644
--- a/frontend/src/Templates.js
+++ b/frontend/src/Templates.js
@@ -392,10 +392,10 @@ class Templates extends React.PureComponent {
return (
<section className="content templates">
<Row>
- <Col xs={12} sm={14}>
+ <Col xs={24} sm={14}>
<h1>Templates ({this.props.data[cs.ModelTemplates].length}) </h1>
</Col>
- <Col xs={12} sm={10} className="align-right">
+ <Col xs={24} sm={10} className="right header-action-break">
<Button
type="primary"
icon="plus"
diff --git a/frontend/src/index.css b/frontend/src/index.css
index d23295ca..4d356b27 100644
--- a/frontend/src/index.css
+++ b/frontend/src/index.css
@@ -315,12 +315,60 @@ td .ant-tag {
display: none;
}
-.align-right {
- text-align: right;
-}
-
@media screen and (max-width: 1200px) {
.dashboard .ant-card {
margin-bottom: 20px;
}
}
+
+@media screen and (max-width: 1023px) {
+ .ant-table-content {
+ overflow-x: auto;
+ }
+
+ .ant-table-thead > tr > th,
+ .ant-table-tbody > tr > td {
+ white-space: nowrap;
+ }
+}
+
+@media screen and (max-width: 768px) {
+ .ant-modal {
+ top: 0 !important;
+ }
+
+ hr {
+ margin: 20px 0;
+ }
+
+ .subscriber-query {
+ padding: 20px
+ }
+
+ .header-action-break {
+ text-align: left;
+ }
+
+ .subscribers.content .slc-subs-section .table-options {
+ margin-top: 20px;
+ padding-top: 20px;
+ border-top: 1px solid #f4f4f4;
+ }
+
+ .subscribers.content .slc-subs-actions a {
+ display: block;
+ margin-bottom: 5px;
+ }
+
+ .ant-modal.subscriber-modal .subscriber-export {
+ margin-top: 10px;
+ }
+
+ .ant-modal.subscriber-modal .subscriber-name {
+ display: block;
+ }
+
+ .dashboard {
+ margin: 24px 12px;
+ }
+}