Skip to content

Commit

Permalink
fix: squad post content
Browse files Browse the repository at this point in the history
  • Loading branch information
sshanzel committed Mar 27, 2024
1 parent 4eb328b commit fd02e6c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/shared/src/components/post/BasePostContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export function BasePostContent({
{isPostPage ? (
<PostContentHeaderMobile
post={post}
className={className.header}
onReadArticle={navigationProps.onReadArticle}
/>
) : (
Expand Down
13 changes: 11 additions & 2 deletions packages/shared/src/components/post/PostContentHeaderMobile.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import React, { ReactElement } from 'react';
import { useRouter } from 'next/router';
import classNames from 'classnames';
import { Button, ButtonSize, ButtonVariant } from '../buttons/Button';
import { ArrowIcon } from '../icons';
import { PostHeaderActions } from './PostHeaderActions';
import { PostNavigationProps } from './common';
import { isNullOrUndefined } from '../../lib/func';
import { WithClassNameProps } from '../utilities';

export function PostContentHeaderMobile({
post,
className,
onReadArticle,
}: Pick<PostNavigationProps, 'onReadArticle' | 'post'>): ReactElement {
}: Pick<PostNavigationProps, 'onReadArticle' | 'post'> &
WithClassNameProps): ReactElement {
const router = useRouter();
const canGoBack =
!!globalThis?.history?.length &&
Expand All @@ -18,7 +22,12 @@ export function PostContentHeaderMobile({
!globalThis?.document?.referrer; // empty referrer means you are from the same site

return (
<span className="-mx-4 flex flex-row items-center border-b border-border-subtlest-tertiary px-4 py-2 tablet:hidden">
<span
className={classNames(
'-mx-4 flex flex-row items-center border-b border-border-subtlest-tertiary px-4 py-2 tablet:hidden',
className,
)}
>
<Button
icon={<ArrowIcon className="-rotate-90" />}
size={ButtonSize.Small}
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/components/post/SquadPostContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ function SquadPostContent({
className={classNames(
'relative flex-1 flex-col tablet:flex-row tablet:pb-0',
className?.container,
isPostPage && 'pt-6 tablet:pt-0',
)}
hasNavigation={hasNavigation}
>
Expand All @@ -100,6 +99,7 @@ function SquadPostContent({
className={{
...className,
onboarding: classNames('mb-6', className?.onboarding),
header: 'mb-6',
navigation: {
actions: 'ml-auto tablet:hidden',
container: 'mb-6 pt-6',
Expand Down
1 change: 1 addition & 0 deletions packages/shared/src/components/post/common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface PostContentClassName {
onboarding?: string;
navigation?: PostNavigationClassName;
fixedNavigation?: PostNavigationClassName;
header?: string;
}

type PostActions = Pick<
Expand Down

0 comments on commit fd02e6c

Please sign in to comment.