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

support: Editor mobile appearance #8760

Merged
merged 13 commits into from
Apr 25, 2024
8 changes: 4 additions & 4 deletions apps/app/src/components/PageControls/PageControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ const Tags = (props: TagsProps): JSX.Element => {
className="btn btn-sm btn-outline-neutral-secondary"
onClick={onClickEditTagsButton}
>
<span className="material-symbols-outlined me-1">local_offer</span>
{t('Tags')}
<span className="material-symbols-outlined">local_offer</span>
<span className="d-none d-sm-inline ms-1">{t('Tags')}</span>
</button>
</div>
);
Expand Down Expand Up @@ -274,7 +274,7 @@ const PageControlsSubstance = (props: PageControlsSubstanceProps): JSX.Element =

return (
<div className={`${styles['grw-page-controls']} hstack gap-2`} ref={pageControlsRef}>
{ isDeviceLargerThanMd && (
{ isViewMode && isDeviceLargerThanMd && (
<SearchButton />
)}

Expand All @@ -285,7 +285,7 @@ const PageControlsSubstance = (props: PageControlsSubstanceProps): JSX.Element =
)}

{ !hideSubControls && (
<div className="hstack gap-1">
<div className={`hstack gap-1 ${!isViewMode && 'd-none d-lg-flex'}`}>
{revisionId != null && _isIPageInfoForOperation && (
<SubscribeButton
status={pageInfo.subscriptionStatus}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export const EditingUserList: FC<Props> = ({ userList }) => {
}

return (
<div className="d-flex flex-column justify-content-end">
<div className="d-flex justify-content-end">
<div className="d-flex flex-column justify-content-start justify-content-sm-end">
<div className="d-flex justify-content-start justify-content-sm-end">
{firstFourUsers.map(user => (
<div className="ms-1">
<UserPicture
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@use '@growi/core/scss/bootstrap/init' as bs;

.editor-navbar :global {
min-height: 72px;
@include bs.media-breakpoint-down(sm) {
min-height: 96px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ export const EditorNavbar = (): JSX.Element => {
const { data: editingUsers } = useEditingUsers();

return (
<div className={`${moduleClass} d-flex justify-content-between px-4 py-1`}>
<PageHeader />
<EditingUserList
<div className={`${moduleClass} d-flex flex-column flex-sm-row justify-content-between ps-3 ps-md-5 ps-xl-4 pe-4 py-1 align-items-sm-end`}>
<div className="order-2 order-sm-1"><PageHeader /></div>
<div className="order-1 order-sm-2"><EditingUserList
userList={editingUsers?.userList ?? []}
/>
</div>
</div>
);
};
12 changes: 12 additions & 0 deletions apps/app/src/components/PageEditor/EditorNavbarBottom.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import dynamic from 'next/dynamic';

import { useDrawerOpened } from '~/stores/ui';

import styles from './EditorNavbarBottom.module.scss';

const moduleClass = styles['grw-editor-navbar-bottom'];
Expand All @@ -8,9 +10,19 @@ const SavePageControls = dynamic(() => import('~/components/SavePageControls').t
const OptionsSelector = dynamic(() => import('~/components/PageEditor/OptionsSelector').then(mod => mod.OptionsSelector), { ssr: false });

const EditorNavbarBottom = (): JSX.Element => {

const { mutate: mutateDrawerOpened } = useDrawerOpened();

return (
<div className="border-top" data-testid="grw-editor-navbar-bottom">
<div className={`flex-expand-horiz align-items-center p-2 ps-md-3 pe-md-4 ${moduleClass}`}>
<a
role="button"
className="nav-link btn-lg p-2 d-md-none me-3 opacity-50"
onClick={() => mutateDrawerOpened(true)}
>
<span className="material-symbols-outlined fs-2">reorder</span>
</a>
<form className="me-auto">
<OptionsSelector />
</form>
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/PageHeader/PageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const PageHeader: FC = () => {
<PagePathHeader
currentPage={currentPage}
/>
<div className="mt-1">
<div className="mt-0 mt-md-1">
<PageTitleHeader
currentPage={currentPage}
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/PageHeader/PageTitleHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export const PageTitleHeader: FC<Props> = (props) => {
</div>
) }
<h1
className={`mb-0 px-2 fs-4
className={`mb-0 mb-sm-1 px-2 fs-4
${isRenameInputShown ? 'invisible' : ''} text-truncate
${isMovable ? 'border border-2 rounded-2' : ''} ${borderColorClass}
`}
Expand Down
Loading