Skip to content

Commit d4327ea

Browse files
authored
Website: Remove unused React components (#1887)
This is a cleanup of a few components we aren't using anymore after [the recent website redesign](#1731) (Select, VersionSelect). Nothing fancy. Confirm the CI checks pass and merge.
1 parent 8e4b1f1 commit d4327ea

File tree

9 files changed

+33
-157
lines changed

9 files changed

+33
-157
lines changed

packages/playground/components/src/icons.tsx

+19
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,22 @@ export const layout = (
143143
export function getLogoDataURL(logo: { mime: string; data: string }): string {
144144
return `data:${logo.mime};base64,${logo.data}`;
145145
}
146+
147+
export function SiteManagerIcon() {
148+
return (
149+
<svg
150+
width="14"
151+
height="14"
152+
viewBox="0 0 14 14"
153+
fill="none"
154+
xmlns="http://www.w3.org/2000/svg"
155+
>
156+
<path
157+
fillRule="evenodd"
158+
clipRule="evenodd"
159+
d="M1.99967 1.58301H4.49967C4.72979 1.58301 4.91634 1.76956 4.91634 1.99967V4.49967C4.91634 4.72979 4.72979 4.91634 4.49967 4.91634H1.99967C1.76956 4.91634 1.58301 4.72979 1.58301 4.49967V1.99967C1.58301 1.76956 1.76956 1.58301 1.99967 1.58301ZM0.333008 1.99967C0.333008 1.0792 1.0792 0.333008 1.99967 0.333008H4.49967C5.42015 0.333008 6.16634 1.0792 6.16634 1.99967V4.49967C6.16634 5.42015 5.42015 6.16634 4.49967 6.16634H1.99967C1.0792 6.16634 0.333008 5.42015 0.333008 4.49967V1.99967ZM9.49967 1.58301H11.9997C12.2298 1.58301 12.4163 1.76956 12.4163 1.99967V4.49967C12.4163 4.72979 12.2298 4.91634 11.9997 4.91634H9.49967C9.26956 4.91634 9.08301 4.72979 9.08301 4.49967V1.99967C9.08301 1.76956 9.26956 1.58301 9.49967 1.58301ZM7.83301 1.99967C7.83301 1.0792 8.5792 0.333008 9.49967 0.333008H11.9997C12.9201 0.333008 13.6663 1.0792 13.6663 1.99967V4.49967C13.6663 5.42015 12.9201 6.16634 11.9997 6.16634H9.49967C8.5792 6.16634 7.83301 5.42015 7.83301 4.49967V1.99967ZM11.9997 9.08301H9.49967C9.26956 9.08301 9.08301 9.26956 9.08301 9.49967V11.9997C9.08301 12.2298 9.26956 12.4163 9.49967 12.4163H11.9997C12.2298 12.4163 12.4163 12.2298 12.4163 11.9997V9.49967C12.4163 9.26956 12.2298 9.08301 11.9997 9.08301ZM9.49967 7.83301C8.5792 7.83301 7.83301 8.5792 7.83301 9.49967V11.9997C7.83301 12.9201 8.5792 13.6663 9.49967 13.6663H11.9997C12.9201 13.6663 13.6663 12.9201 13.6663 11.9997V9.49967C13.6663 8.5792 12.9201 7.83301 11.9997 7.83301H9.49967ZM1.99967 9.08301H4.49967C4.72979 9.08301 4.91634 9.26956 4.91634 9.49967V11.9997C4.91634 12.2298 4.72979 12.4163 4.49967 12.4163H1.99967C1.76956 12.4163 1.58301 12.2298 1.58301 11.9997V9.49967C1.58301 9.26956 1.76956 9.08301 1.99967 9.08301ZM0.333008 9.49967C0.333008 8.5792 1.0792 7.83301 1.99967 7.83301H4.49967C5.42015 7.83301 6.16634 8.5792 6.16634 9.49967V11.9997C6.16634 12.9201 5.42015 13.6663 4.49967 13.6663H1.99967C1.0792 13.6663 0.333008 12.9201 0.333008 11.9997V9.49967Z"
160+
fill="white"
161+
/>
162+
</svg>
163+
);
164+
}

packages/playground/website/src/components/browser-chrome/index.tsx

+14-2
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@ import React from 'react';
22
import css from './style.module.css';
33
import AddressBar from '../address-bar';
44
import classNames from 'classnames';
5-
import { OpenSiteManagerButton } from '../open-site-manager-button';
65
import {
76
useAppSelector,
87
getActiveClientInfo,
98
useActiveSite,
9+
useAppDispatch,
1010
} from '../../lib/state/redux/store';
1111
import { SyncLocalFilesButton } from '../sync-local-files-button';
1212
import { Dropdown, Icon } from '@wordpress/components';
1313
import { cog } from '@wordpress/icons';
1414
import Button from '../button';
1515
import { ActiveSiteSettingsForm } from '../site-manager/site-settings-form';
16+
import { setSiteManagerOpen } from '../../lib/state/redux/slice-ui';
17+
import { SiteManagerIcon } from '@wp-playground/components';
1618

1719
interface BrowserChromeProps {
1820
children?: React.ReactNode;
@@ -29,6 +31,7 @@ export default function BrowserChrome({
2931
const activeSite = useActiveSite();
3032
const showAddressBar = !!clientInfo;
3133
const url = clientInfo?.url;
34+
const dispatch = useAppDispatch();
3235
const addressBarClass = classNames(css.addressBarSlot, {
3336
[css.isHidden]: !showAddressBar,
3437
});
@@ -49,7 +52,16 @@ export default function BrowserChrome({
4952
aria-label="Playground toolbar"
5053
>
5154
<div className={css.windowControls}>
52-
<OpenSiteManagerButton />
55+
<Button
56+
variant="browser-chrome"
57+
aria-label="Open Site Manager"
58+
className={css.openSiteManagerButton}
59+
onClick={() => {
60+
dispatch(setSiteManagerOpen(true));
61+
}}
62+
>
63+
<SiteManagerIcon />
64+
</Button>
5365
</div>
5466

5567
<div className={addressBarClass}>

packages/playground/website/src/components/edit-site-settings-button/index.tsx

-42
This file was deleted.

packages/playground/website/src/components/edit-site-settings-button/style.module.css

-3
This file was deleted.

packages/playground/website/src/components/open-site-manager-button/index.tsx

-42
This file was deleted.

packages/playground/website/src/components/open-site-manager-button/style.module.css

-3
This file was deleted.

packages/playground/website/src/components/select/index.tsx

-18
This file was deleted.

packages/playground/website/src/components/select/style.module.css

-13
This file was deleted.

packages/playground/website/src/components/version-select/index.tsx

-34
This file was deleted.

0 commit comments

Comments
 (0)