Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const AccountSection = (): ReactElement => {
icon: SettingsIcon,
},
{
title: 'Subscriptions',
title: 'Payment & Subscription',
href: `${settingsUrl}/subscription`,
icon: CreditCardIcon,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import useFeedSettings from '../../../hooks/useFeedSettings';
import { useShareOrCopyLink } from '../../../hooks/useShareOrCopyLink';
import { LogEvent } from '../../../lib/log';
import { plusUrl } from '../../../lib/constants';
import { visibleOnGroupHover } from './common';

interface SquadOptionsButtonProps {
squad: Squad;
Expand All @@ -39,7 +40,7 @@ export function SquadOptionsButton({
}: SquadOptionsButtonProps): ReactElement {
const { openModal } = useLazyModal();
const { user } = useAuthContext();
const { data: campaign } = useCampaignById(squad.flags.campaignId);
const { data: campaign } = useCampaignById(squad.flags?.campaignId ?? '');
const isBooster = campaign && user?.id === campaign.user.id;
const [, onShareOrCopy] = useShareOrCopyLink({
link: squad.permalink,
Expand All @@ -57,7 +58,11 @@ export function SquadOptionsButton({
const options = useMemo(() => {
const blockAction = isSourceBlocked ? unblockSource : blockSource;
const list: MenuItemProps[] = [
{ label: 'Share via', icon: <ShareIcon />, action: onShareOrCopy },
{
label: 'Share via',
icon: <ShareIcon />,
action: () => onShareOrCopy(),
},
{
label: 'Hide',
icon: <EyeIcon />,
Expand All @@ -81,7 +86,7 @@ export function SquadOptionsButton({

if (isBooster) {
list.unshift({
label: 'Manade Ad',
label: 'Manage ad',
icon: <TrendingIcon />,
action: () =>
openModal({
Expand Down Expand Up @@ -110,7 +115,7 @@ export function SquadOptionsButton({
variant={ButtonVariant.Tertiary}
icon={<MenuIcon />}
size={ButtonSize.Small}
className={classNames('invisible z-1 group-hover:visible', className)}
className={classNames(visibleOnGroupHover, 'z-1', className)}
/>
</DropdownMenuTrigger>
<DropdownMenuContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useQueryClient } from '@tanstack/react-query';
import { Button, ButtonSize, ButtonVariant } from '../../buttons/Button';
import { EyeCancelIcon, MenuIcon as KebabIcon, PinIcon } from '../../icons';
import { MenuIcon } from '../../MenuIcon';
import { visibleOnGroupHover } from '../common/common';
import {
DropdownMenu,
DropdownMenuContent,
Expand Down Expand Up @@ -70,10 +71,7 @@ const HighlightCardOptionsContent = ({
variant={ButtonVariant.Tertiary}
size={ButtonSize.Small}
icon={<KebabIcon />}
className={classNames(
'invisible z-1 my-auto group-hover:visible',
className,
)}
className={classNames(visibleOnGroupHover, 'z-1 my-auto', className)}
/>
</DropdownMenuTrigger>
<DropdownMenuContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
FlagIcon,
DownvoteIcon,
AddUserIcon,
RemoveUserIcon,
BlockIcon,
GiftIcon,
MenuIcon,
Expand Down Expand Up @@ -258,7 +259,7 @@ function CommentActionButtonsV1({
const isFollowingUser = isFollowingContent(author?.contentPreference);

commentOptions.push({
icon: <AddUserIcon />,
icon: isFollowingUser ? <RemoveUserIcon /> : <AddUserIcon />,
label: `${isFollowingUser ? 'Unfollow' : 'Follow'} ${authorName}`,
action: () => {
const opts = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
FlagIcon,
DownvoteIcon,
AddUserIcon,
RemoveUserIcon,
BlockIcon,
GiftIcon,
MenuIcon,
Expand Down Expand Up @@ -258,7 +259,7 @@ export default function CommentActionButtons({
const isFollowingUser = isFollowingContent(author?.contentPreference);

commentOptions.push({
icon: <AddUserIcon />,
icon: isFollowingUser ? <RemoveUserIcon /> : <AddUserIcon />,
label: `${isFollowingUser ? 'Unfollow' : 'Follow'} ${authorName}`,
action: () => {
const opts = {
Expand Down
3 changes: 2 additions & 1 deletion packages/shared/src/components/feeds/MobileFeedActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export function MobileFeedActions(): ReactElement {
<Button
icon={<SettingsIcon />}
variant={ButtonVariant.Tertiary}
className="shell-press"
onClick={() => setIsMenuOpen(true)}
/>
<RootPortal>
Expand All @@ -75,7 +76,7 @@ export function MobileFeedActions(): ReactElement {
/>
</RootPortal>
<Link href={`${webappUrl}${user.username}`} passHref>
<a>
<a className="shell-press">
<ProfilePictureWithIndicator user={user} />
</a>
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ interface ChipItem {
const GROUP_ORDER: ChipGroup[] = ['forYou', 'categories', 'rest'];

const chipBaseClass =
'shrink-0 rounded-10 border px-2.5 py-1.5 font-bold transition-colors typo-callout';
'shell-press shrink-0 rounded-10 border px-2.5 py-1.5 font-bold typo-callout';
const chipActiveClass =
'border-border-subtlest-tertiary bg-surface-float text-text-primary hover:bg-surface-hover';
const chipInactiveClass =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export function FeedExploreHeader({
icon={<CalendarIcon size={IconSize.Medium} />}
selectedIndex={period}
options={periodTexts}
drawerProps={{ displayCloseButton: true }}
onChange={(_, index) => setPeriod(index)}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const NotificationOptionsButton = ({
// Tertiary is the flat variant — transparent, no background or
// border (Float carries a faint surface-float background).
variant={ButtonVariant.Tertiary}
icon={<MenuIcon className="rotate-90" />}
icon={<MenuIcon />}
size={ButtonSize.XSmall}
/>
</DropdownMenuTrigger>
Expand Down
7 changes: 5 additions & 2 deletions packages/shared/src/components/post/MobilePostFloatingBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ function MobilePostFloatingBarV1({
variant={ButtonVariant.Tertiary}
color={ButtonColor.Avocado}
size={ButtonSize.Medium}
className="shell-press"
>
{upvoteCount > 0 && (
<InteractionCounter className={counterClasses} value={upvoteCount} />
Expand All @@ -135,6 +136,7 @@ function MobilePostFloatingBarV1({
variant={ButtonVariant.Tertiary}
color={ButtonColor.Ketchup}
size={ButtonSize.Medium}
className="shell-press"
/>
<QuaternaryButton
id="mobile-comment-post-btn"
Expand All @@ -143,7 +145,7 @@ function MobilePostFloatingBarV1({
onClick={() => onCommentClick(LogOrigin.PostCommentButton)}
icon={<CommentIcon secondary={post.commented} />}
size={ButtonSize.Medium}
className="btn-tertiary-blueCheese"
className="shell-press btn-tertiary-blueCheese"
>
{commentCount > 0 && (
<InteractionCounter className={counterClasses} value={commentCount} />
Expand All @@ -157,7 +159,7 @@ function MobilePostFloatingBarV1({
pressed: post.bookmarked,
onClick: onToggleBookmark,
size: ButtonSize.Medium,
className: 'btn-tertiary-bun',
className: 'shell-press btn-tertiary-bun',
}}
/>
<QuaternaryButton
Expand All @@ -168,6 +170,7 @@ function MobilePostFloatingBarV1({
variant={ButtonVariant.Tertiary}
color={ButtonColor.Cabbage}
size={ButtonSize.Medium}
className="shell-press"
/>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/components/post/PostContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export function PostContentRaw({
/>
</div>
<h1
className="break-words font-bold typo-large-title"
className="text-balance break-words font-bold typo-large-title"
data-testid="post-modal-title"
>
<ArticleLink href={post.permalink} onClick={onReadArticle}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export const CollectionPostContentRaw = ({
/>
</div>
<h1
className="break-words font-bold typo-large-title"
className="text-balance break-words font-bold typo-large-title"
data-testid="post-modal-title"
>
{post.title}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ const PostFocusCardRaw = ({
<div className="flex min-w-0 flex-1 flex-col gap-4">
<h1
className={classNames(
'break-words font-bold text-text-primary typo-title3 tablet:typo-title1',
'text-balance break-words font-bold text-text-primary typo-title3 tablet:typo-title1',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: the PR description gives the reason for leaving feed card titles alone as "balance interacts with clamping", but here text-balance is combined with line-clamp-3 whenever onClose is set (the feed preview modal). So the modal gets the exact combination the description avoids. Could you either scope balance to the post page (!onClose && 'text-balance') or confirm the clamped modal title still looks right with long titles? Title balancing in the three post headers also isn't listed under "What changed" (it only shows up in the first commit message). Worth adding so the scope is visible.

Reviewed by AI.

// On the post page the reader came to read, so the title is
// always shown in full and the button flows below it; only
// the modal (a feed preview) clamps it.
Expand Down
10 changes: 5 additions & 5 deletions packages/shared/src/components/profile/ProfileSettingsMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const useAccountPageItems = ({ onClose }: { onClose?: () => void } = {}) => {
title: null,
items: {
profile: {
title: 'Profile details',
title: 'Profile',
icon: UserIcon,
href: `${settingsUrl}/profile`,
},
Expand Down Expand Up @@ -139,7 +139,7 @@ const useAccountPageItems = ({ onClose }: { onClose?: () => void } = {}) => {
href: `${settingsUrl}/composition`,
},
invite: {
title: 'Invite Friends',
title: 'Invite friends',
icon: InviteIcon,
href: `${settingsUrl}/invite`,
},
Expand Down Expand Up @@ -199,7 +199,7 @@ const useAccountPageItems = ({ onClose }: { onClose?: () => void } = {}) => {
href: `${settingsUrl}/profile/experience/certification`,
},
openSource: {
title: 'Open Source',
title: 'Open source',
icon: TerminalIcon,
href: `${settingsUrl}/profile/experience/opensource`,
},
Expand Down Expand Up @@ -227,7 +227,7 @@ const useAccountPageItems = ({ onClose }: { onClose?: () => void } = {}) => {
},
}),
gamification: {
title: 'Feature visibility',
title: 'Streaks & gamification',
icon: EyeIcon,
href: `${settingsUrl}/customization/gamification`,
},
Expand Down Expand Up @@ -275,7 +275,7 @@ const useAccountPageItems = ({ onClose }: { onClose?: () => void } = {}) => {
title: 'Billing and Monetization',
items: {
subscription: {
title: 'Subscriptions',
title: 'Payment & Subscription',
icon: CreditCardIcon,
href: `${settingsUrl}/subscription`,
},
Expand Down
8 changes: 8 additions & 0 deletions packages/shared/src/components/shell/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// The numbers of the phone shell (Mobile UX review, chapter 10).
export const swipe = {
lockDistance: 10,
commitDistance: 56,
coneRatio: 2,
velocity: 0.3,
velocityDistance: 32,
};
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ const SidebarSettingsButton = (): ReactElement => {

const billingItems: ProfileSectionItemProps[] = [
{
title: 'Subscriptions',
title: 'Payment & Subscription',
href: `${settingsUrl}/subscription`,
icon: CreditCardIcon,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const SettingsPanelSection = ({
key: 'main',
items: [
{
title: 'Profile details',
title: 'Profile',
path: settingsDefaultPath,
icon: (active: boolean) => (
<ListIcon Icon={() => <UserIcon secondary={active} />} />
Expand Down Expand Up @@ -109,7 +109,7 @@ export const SettingsPanelSection = ({
),
},
{
title: 'Invite Friends',
title: 'Invite friends',
path: `${settingsUrl}/invite`,
icon: (active: boolean) => (
<ListIcon Icon={() => <InviteIcon secondary={active} />} />
Expand Down Expand Up @@ -191,7 +191,7 @@ export const SettingsPanelSection = ({
),
},
{
title: 'Open Source',
title: 'Open source',
path: `${settingsUrl}/profile/experience/opensource`,
icon: (active: boolean) => (
<ListIcon Icon={() => <TerminalIcon secondary={active} />} />
Expand Down Expand Up @@ -220,7 +220,7 @@ export const SettingsPanelSection = ({
{
// The streak settings live on this same combined page, so there's
// no separate "Streaks" entry.
title: 'Feature visibility',
title: 'Streaks & gamification',
path: `${settingsUrl}/customization/gamification`,
icon: (active: boolean) => (
<ListIcon Icon={() => <EyeIcon secondary={active} />} />
Expand Down Expand Up @@ -253,7 +253,7 @@ export const SettingsPanelSection = ({
title: 'Billing and Monetization',
items: [
{
title: 'Subscriptions',
title: 'Payment & Subscription',
path: `${settingsUrl}/subscription`,
icon: (active: boolean) => (
<ListIcon Icon={() => <CreditCardIcon secondary={active} />} />
Expand Down
Loading
Loading