Skip to content

Commit eec066d

Browse files
authored
UI improvements: responsive design and streamlined footer (#780)
* refactor(Footer): streamline footer component by removing unused links and buttons - Simplified by removing unused external links, buttons, and unused `JS13K` logic - Adjusted padding for a cleaner layout * style: adjust padding and heights for consistent tab and header components - Reduced padding in PageTabs and adjusted heights in Tabs, Tab, and MainHeader - Removed redundant pages counter in MainHeader for a cleaner UI * style(MainHeader): hide labels and buttons on smaller screens for cleaner layout - Added `lg:inline` and `lg:block` classes to selectively display labels and buttons on larger screens - Improved responsive design for a better user experience on smaller devices
1 parent 68ae845 commit eec066d

File tree

5 files changed

+15
-230
lines changed

5 files changed

+15
-230
lines changed

src/components/Footer.jsx

Lines changed: 1 addition & 213 deletions
Original file line numberDiff line numberDiff line change
@@ -70,230 +70,18 @@ export default class Footer extends Component {
7070
return (
7171
<div
7272
id="footer"
73-
class="flex w-full items-center justify-between z-10 bg-black py-4 px-6 text-gray-500 text-xs"
73+
class="flex w-full items-center justify-between z-10 bg-black py-2 px-6 text-gray-500 text-xs"
7474
>
7575
{window.zenumlDesktop ? (
7676
<div></div>
7777
) : (
7878
//no footer if it in electron
7979
<div class="flex items-center gap-4">
80-
<a
81-
href="https://www.ZenUML.com/"
82-
target="_blank"
83-
rel="noopener noreferrer"
84-
className="hover:opacity-80 duration-200"
85-
>
86-
&copy; ZenUML
87-
</a>
8880
<span class="text-gray-600 text-xs">
8981
v2.0.0 ({__COMMITHASH__})
9082
</span>
91-
<a
92-
aria-label="Tweet about 'ZenUML'"
93-
href="http://twitter.com/share?url=https://www.zenuml.com/&text=ZenUML - A blazing fast %26 offline UML generator! via @ZenUML&related=ZenUML&hashtags=uml,zenuml,playground,offline"
94-
target="_blank"
95-
rel="noopener noreferrer"
96-
className="hover:opacity-80 duration-200"
97-
>
98-
<svg
99-
style={{
100-
width: '16px',
101-
height: '16px',
102-
verticalAlign: 'text-bottom',
103-
fill: 'currentColor',
104-
}}
105-
>
106-
<use xlinkHref="#twitter-icon" />
107-
</svg>
108-
</a>
109-
<a
110-
className="hover:opacity-80 duration-200"
111-
href={
112-
'https://marketplace.atlassian.com/apps/1218380/zenuml-sequence-diagram'
113-
}
114-
target="_blank"
115-
>
116-
&nbsp;Confluence Plugin&nbsp;
117-
</a>
118-
<a
119-
className="hover:opacity-80 duration-200"
120-
href={
121-
'https://chrome.google.com/webstore/detail/web-sequence/kcpganeflmhffnlofpdmcjklmdpbbmef'
122-
}
123-
target="_blank"
124-
>
125-
&nbsp;Chrome Extension&nbsp;
126-
</a>
12783
</div>
12884
)}
129-
<div class="flex gap-4">
130-
<a
131-
className="hover:opacity-80 duration-200"
132-
href={'End-User-License-Agreement/index.html'}
133-
target="_blank"
134-
>
135-
&nbsp;End User License Agreement&nbsp;
136-
</a>
137-
<a
138-
className="hover:opacity-80 duration-200"
139-
href={'privacy-policy/privacy-policy.html'}
140-
target="_blank"
141-
>
142-
&nbsp;Privacy Policy&nbsp;
143-
</a>
144-
<button
145-
className="hover:opacity-80 duration-200 text-gray-500 text-xs"
146-
onClick={this.props.helpBtnClickHandler}
147-
>
148-
&nbsp;Help & Version&nbsp;
149-
</button>
150-
</div>
151-
{this.props.prefs.isJs13kModeOn ? (
152-
<div class="flex flex-v-center">
153-
<JS13K
154-
isOpen={this.state.isJs13kDropdownOpen}
155-
codeSize={this.props.codeSize}
156-
onClick={this.js13kClickHandler.bind(this)}
157-
onBlur={() =>
158-
setTimeout(
159-
async () =>
160-
await this.setState({ isJs13kDropdownOpen: false }),
161-
300,
162-
)
163-
}
164-
/>
165-
{this.state.isJs13kDropdownOpen && (
166-
<div className="js13k__dropdown">
167-
<button
168-
class="btn"
169-
style={{
170-
width: '200px',
171-
display: 'block',
172-
marginBottom: '16px',
173-
}}
174-
onClick={this.props.onJs13KDownloadBtnClick}
175-
>
176-
Download game as zip
177-
</button>
178-
<a
179-
class="btn"
180-
rel="noopener"
181-
style={{
182-
width: '200px',
183-
display: 'block',
184-
marginBottom: '16px',
185-
}}
186-
href="https://pasteboard.co/"
187-
target="_blank"
188-
>
189-
Upload Image
190-
</a>
191-
<button
192-
class="btn"
193-
style={{ width: '200px', display: 'block' }}
194-
onClick={this.props.onJs13KHelpBtnClick}
195-
>
196-
Help
197-
</button>
198-
</div>
199-
)}
200-
</div>
201-
) : null}
202-
203-
<div class="footer__right hidden">
204-
<button
205-
style="display: none;"
206-
onClick={this.props.saveHtmlBtnClickHandler}
207-
id="saveHtmlBtn"
208-
class="mode-btn hint--rounded hint--top-left hide-on-mobile"
209-
aria-label="Save as HTML file"
210-
>
211-
<svg viewBox="0 0 24 24">
212-
<path d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z" />
213-
</svg>
214-
</button>
215-
<svg style="display: none;" xmlns="http://www.w3.org/2000/svg">
216-
<symbol id="codepen-logo" viewBox="0 0 120 120">
217-
<path
218-
class="outer-ring"
219-
d="M60.048 0C26.884 0 0 26.9 0 60.048s26.884 60 60 60.047c33.163 0 60.047-26.883 60.047-60.047 S93.211 0 60 0z M60.048 110.233c-27.673 0-50.186-22.514-50.186-50.186S32.375 9.9 60 9.9 c27.672 0 50.2 22.5 50.2 50.186S87.72 110.2 60 110.233z"
220-
/>
221-
<path
222-
class="inner-box"
223-
d="M97.147 48.319c-0.007-0.047-0.019-0.092-0.026-0.139c-0.016-0.09-0.032-0.18-0.056-0.268 c-0.014-0.053-0.033-0.104-0.05-0.154c-0.025-0.078-0.051-0.156-0.082-0.232c-0.021-0.053-0.047-0.105-0.071-0.156 c-0.033-0.072-0.068-0.143-0.108-0.211c-0.029-0.051-0.061-0.1-0.091-0.148c-0.043-0.066-0.087-0.131-0.135-0.193 c-0.035-0.047-0.072-0.094-0.109-0.139c-0.051-0.059-0.104-0.117-0.159-0.172c-0.042-0.043-0.083-0.086-0.127-0.125 c-0.059-0.053-0.119-0.104-0.181-0.152c-0.048-0.037-0.095-0.074-0.145-0.109c-0.019-0.012-0.035-0.027-0.053-0.039L61.817 23.5 c-1.072-0.715-2.468-0.715-3.54 0L24.34 46.081c-0.018 0.012-0.034 0.027-0.053 0.039c-0.05 0.035-0.097 0.072-0.144 0.1 c-0.062 0.049-0.123 0.1-0.181 0.152c-0.045 0.039-0.086 0.082-0.128 0.125c-0.056 0.055-0.108 0.113-0.158 0.2 c-0.038 0.045-0.075 0.092-0.11 0.139c-0.047 0.062-0.092 0.127-0.134 0.193c-0.032 0.049-0.062 0.098-0.092 0.1 c-0.039 0.068-0.074 0.139-0.108 0.211c-0.024 0.051-0.05 0.104-0.071 0.156c-0.031 0.076-0.057 0.154-0.082 0.2 c-0.017 0.051-0.035 0.102-0.05 0.154c-0.023 0.088-0.039 0.178-0.056 0.268c-0.008 0.047-0.02 0.092-0.025 0.1 c-0.019 0.137-0.029 0.275-0.029 0.416V71.36c0 0.1 0 0.3 0 0.418c0.006 0 0 0.1 0 0.1 c0.017 0.1 0 0.2 0.1 0.268c0.015 0.1 0 0.1 0.1 0.154c0.025 0.1 0.1 0.2 0.1 0.2 c0.021 0.1 0 0.1 0.1 0.154c0.034 0.1 0.1 0.1 0.1 0.213c0.029 0 0.1 0.1 0.1 0.1 c0.042 0.1 0.1 0.1 0.1 0.193c0.035 0 0.1 0.1 0.1 0.139c0.05 0.1 0.1 0.1 0.2 0.2 c0.042 0 0.1 0.1 0.1 0.125c0.058 0.1 0.1 0.1 0.2 0.152c0.047 0 0.1 0.1 0.1 0.1 c0.019 0 0 0 0.1 0.039L58.277 96.64c0.536 0.4 1.2 0.5 1.8 0.537c0.616 0 1.233-0.18 1.77-0.537 l33.938-22.625c0.018-0.012 0.034-0.027 0.053-0.039c0.05-0.035 0.097-0.072 0.145-0.109c0.062-0.049 0.122-0.1 0.181-0.152 c0.044-0.039 0.085-0.082 0.127-0.125c0.056-0.055 0.108-0.113 0.159-0.172c0.037-0.045 0.074-0.09 0.109-0.139 c0.048-0.062 0.092-0.127 0.135-0.193c0.03-0.049 0.062-0.098 0.091-0.146c0.04-0.07 0.075-0.141 0.108-0.213 c0.024-0.051 0.05-0.102 0.071-0.154c0.031-0.078 0.057-0.156 0.082-0.234c0.017-0.051 0.036-0.102 0.05-0.154 c0.023-0.088 0.04-0.178 0.056-0.268c0.008-0.045 0.02-0.092 0.026-0.137c0.018-0.139 0.028-0.277 0.028-0.418V48.735 C97.176 48.6 97.2 48.5 97.1 48.319z M63.238 32.073l25.001 16.666L77.072 56.21l-13.834-9.254V32.073z M56.856 32.1 v14.883L43.023 56.21l-11.168-7.471L56.856 32.073z M29.301 54.708l7.983 5.34l-7.983 5.34V54.708z M56.856 88.022L31.855 71.4 l11.168-7.469l13.833 9.252V88.022z M60.048 67.597l-11.286-7.549l11.286-7.549l11.285 7.549L60.048 67.597z M63.238 88.022V73.14 l13.834-9.252l11.167 7.469L63.238 88.022z M90.794 65.388l-7.982-5.34l7.982-5.34V65.388z"
224-
/>
225-
</symbol>
226-
</svg>
227-
228-
<button
229-
onClick={this.props.codepenBtnClickHandler}
230-
id="codepenBtn"
231-
class="mode-btn hint--rounded hint--top-left hide-on-mobile"
232-
style="display: none"
233-
aria-label="Edit on CodePen"
234-
>
235-
<svg fill="currentColor">
236-
<use xlinkHref="#codepen-logo" />
237-
</svg>
238-
</button>
239-
240-
<button
241-
id="screenshotBtn"
242-
class="mode-btn hint--rounded hint--top-left show-when-extension"
243-
style="display: none"
244-
onClick={this.props.screenshotBtnClickHandler}
245-
aria-label="Take screenshot of preview"
246-
>
247-
<svg style="width:24px;height:24px" viewBox="0 0 24 24">
248-
<path
249-
fill="currentColor"
250-
d="M4,4H7L9,2H15L17,4H20A2,2 0 0,1 22,6V18A2,2 0 0,1 20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4M12,7A5,5 0 0,0 7,12A5,5 0 0,0 12,17A5,5 0 0,0 17,12A5,5 0 0,0 12,7M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9Z"
251-
/>
252-
</svg>
253-
</button>
254-
<button
255-
style="display:none;"
256-
class="mode-btn hint--top-left hint--rounded hide-on-mobile"
257-
aria-label="Detach Preview"
258-
onClick={this.props.detachedPreviewBtnHandler}
259-
>
260-
<svg viewBox="0 0 24 24">
261-
<path
262-
fill="currentColor"
263-
d="M22,17V7H6V17H22M22,5A2,2 0 0,1 24,7V17C24,18.11 23.1,19 22,19H16V21H18V23H10V21H12V19H6C4.89,19 4,18.11 4,17V7A2,2 0 0,1 6,5H22M2,3V15H0V3A2,2 0 0,1 2,1H20V3H2Z"
264-
/>
265-
</svg>
266-
</button>
267-
268-
<button
269-
onClick={this.props.notificationsBtnClickHandler}
270-
id="notificationsBtn"
271-
class={`notifications-btn mode-btn hint--top-left hint--rounded has-new ${
272-
this.props.hasUnseenChangelog ? 'has-new' : ''
273-
}`}
274-
style="display: none"
275-
aria-label="See Changelog"
276-
>
277-
<svg viewBox="0 0 24 24">
278-
<path
279-
fill="currentColor"
280-
d="M14,20A2,2 0 0,1 12,22A2,2 0 0,1 10,20H14M12,2A1,1 0 0,1 13,3V4.08C15.84,4.56 18,7.03 18,10V16L21,19H3L6,16V10C6,7.03 8.16,4.56 11,4.08V3A1,1 0 0,1 12,2Z"
281-
/>
282-
</svg>
283-
<span class="notifications-btn__dot" />
284-
</button>
285-
{/*<Button*/}
286-
{/* onClick={this.props.settingsBtnClickHandler}*/}
287-
{/* data-event-category="ui"*/}
288-
{/* data-event-action="settingsBtnClick"*/}
289-
{/* class="mode-btn hint--top-left hint--rounded"*/}
290-
{/* aria-label="Settings"*/}
291-
{/*>*/}
292-
{/* <svg>*/}
293-
{/* <use xlinkHref="#settings-icon" />*/}
294-
{/* </svg>*/}
295-
{/*</Button>*/}
296-
</div>
29785
</div>
29886
);
29987
}

src/components/MainHeader.jsx

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export function MainHeader(props) {
141141
<svg className="h-5 w-5">
142142
<use xlinkHref="#icon-plus" />
143143
</svg>
144-
<span>New</span>
144+
<span className="hidden lg:inline">New</span>
145145
</button>
146146
<button
147147
id="openItemsBtn"
@@ -154,7 +154,7 @@ export function MainHeader(props) {
154154
<svg className="h-5 w-5">
155155
<use xlinkHref="#icon-gallery" />
156156
</svg>
157-
<span>My library</span>
157+
<span className="hidden lg:inline">My library</span>
158158
</button>
159159
</div>
160160
<div>
@@ -177,11 +177,6 @@ export function MainHeader(props) {
177177
<svg className="h-5 w-5">
178178
<use xlinkHref="#icon-pen" />
179179
</svg>
180-
{props.currentItem && props.currentItem.pages && (
181-
<span className="ml-2 px-2 py-0.5 text-xs rounded-full bg-black-600 text-gray-300">
182-
{props.currentItem.pages.length} {props.currentItem.pages.length === 1 ? 'page' : 'pages'}
183-
</span>
184-
)}
185180
</div>
186181
)}
187182
</div>
@@ -198,7 +193,7 @@ export function MainHeader(props) {
198193

199194
{!window.user ? (
200195
<button
201-
className="h-10 px-4 bg-primary rounded-lg text-gray-100 font-semibold hover:opacity-80 duration-200"
196+
className="hidden lg:inline h-10 px-4 bg-primary rounded-lg text-gray-100 font-semibold hover:opacity-80 duration-200"
202197
aria-label="Share diagram link"
203198
onClick={props.onLogin.bind(this)}
204199
>
@@ -213,7 +208,7 @@ export function MainHeader(props) {
213208
onVisibilityChange={setIsSharePanelVisible}
214209
trigger={
215210
<button
216-
className="h-10 px-4 bg-primary rounded-lg text-white font-semibold hover:opacity-80 duration-200"
211+
className="hidden lg:inline h-10 px-4 bg-primary rounded-lg text-white font-semibold hover:opacity-80 duration-200"
217212
aria-label="Share diagram link"
218213
onClick={shareClickHandler}
219214
>
@@ -230,10 +225,12 @@ export function MainHeader(props) {
230225
/>
231226
)}
232227
{featureToggle.isPaymentEnabled ? (
233-
<ProductVersionLabel
234-
user={props.user}
235-
clickHandler={props.proBtnHandler}
236-
/>
228+
<div className="hidden lg:block">
229+
<ProductVersionLabel
230+
user={props.user}
231+
clickHandler={props.proBtnHandler}
232+
/>
233+
</div>
237234
) : null}
238235

239236
{props.user ? (

src/components/PageTabs.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class PageTabs extends Component {
5656
return (
5757
<div
5858
key={page.id}
59-
className={`relative flex items-center group rounded-t-lg group mx-1 px-3 py-2 gap-2 ${page.id === currentPageId ? 'bg-primary' : 'bg-black-600'} ${index === 0 ? '' : 'pr-7'}`}
59+
className={`relative flex items-center group rounded-t-lg group mx-1 px-3 py-1 gap-2 ${page.id === currentPageId ? 'bg-primary' : 'bg-black-600'} ${index === 0 ? '' : 'pr-7'}`}
6060
>
6161
<button
6262
className={`text-sm font-medium w-full h-full ${page.id === currentPageId
@@ -91,7 +91,7 @@ export class PageTabs extends Component {
9191
);
9292
})}
9393
<button
94-
className="ml-1 px-3 py-2 bg-black-600 text-gray-400 hover:bg-black-700 hover:text-gray-300 rounded-lg text-sm font-medium transition-colors duration-200 flex items-center"
94+
className="ml-1 px-3 py-1 bg-black-600 text-gray-400 hover:bg-black-700 hover:text-gray-300 rounded-lg text-sm font-medium transition-colors duration-200 flex items-center"
9595
onClick={this.handleAddPage}
9696
title="Add new page"
9797
>

src/components/Tab.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Tab extends Component {
2020
} = this;
2121

2222
let className =
23-
'h-12 flex items-center px-10 tab-list-item bg-black-800 font-semibold';
23+
'h-8 flex items-center px-10 tab-list-item bg-black-800 font-semibold';
2424

2525
if (activeTab === label) {
2626
className += ' border-b border-primary bg-black-500 text-primary-400';

src/components/Tabs.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Tabs extends Component {
4848
} = this;
4949
return (
5050
<div className="h-full flex flex-col">
51-
<div className="h-12 flex justify-between items-center bg-black-500">
51+
<div className="h-8 flex justify-between items-center bg-black-500">
5252
<div className="flex justify-start tab-list">
5353
{children.map((child) => {
5454
const { label, lineOfCode } = child.props;

0 commit comments

Comments
 (0)