Skip to content

Commit 45da302

Browse files
authored
fix(web): link and font size adjustments (#498)
Closes #488 - fixes font size on mobile app - fixes links to apify store
1 parent 4fd8e8d commit 45da302

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

src/web/src/components/actor/ActorCard.tsx

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from "react";
22
import styled from "styled-components";
33

44
import { Actor } from "../../types";
5-
import { Text, Box, IconButton, ICON_BUTTON_VARIANTS, ActorAvatar, theme, clampLines } from "@apify/ui-library";
5+
import { Text, Box, ActorAvatar, theme, clampLines, Link } from "@apify/ui-library";
66
import { PeopleIcon, CoinIcon, StarEmptyIcon, ExternalLinkIcon } from "@apify/ui-icons";
77
import { formatNumber, formatDecimalNumber, formatPricing } from "../../utils/formatting";
88
import { ActorStats, StructuredPricingInfo } from "../../types";
@@ -50,6 +50,29 @@ const BoxGroup = styled(Box)`
5050
align-items: center;
5151
`;
5252

53+
const ExternalLinkButton = styled(Link)`
54+
display: inline-flex;
55+
align-items: center;
56+
justify-content: center;
57+
box-sizing: border-box;
58+
width: 32px;
59+
height: 32px;
60+
border-radius: ${theme.radius.radius6};
61+
background-color: ${theme.color.neutral.backgroundMuted};
62+
border: 1px solid ${theme.color.neutral.border};
63+
color: ${theme.color.neutral.text};
64+
flex-shrink: 0;
65+
text-decoration: none;
66+
67+
&:hover {
68+
background-color: ${theme.color.neutral.hover};
69+
}
70+
71+
& > * {
72+
pointer-events: none;
73+
}
74+
`;
75+
5376
const StyledSeparator = styled(Box)`
5477
border-left: 1px solid ${theme.color.neutral.separatorSubtle};
5578
height: 8px;
@@ -200,8 +223,7 @@ export const ActorCard: React.FC<ActorCardProps> = ({
200223
</ActorTitleWrapper>
201224
</ActorHeader>
202225
{customActionButton || (
203-
// @ts-expect-error IconButton doesn't recognize `to` and `hideExternalIcon` props from Button
204-
<IconButton Icon={ExternalLinkIcon} variant={ICON_BUTTON_VARIANTS.BORDERED} to={actor.url} hideExternalIcon className="flexShrink0" />
226+
<ExternalLinkButton to={actor.url} hideExternalIcon className="flexShrink0"><ExternalLinkIcon size="16" /></ExternalLinkButton>
205227
)}
206228
</ActorHeaderWithActionButton>
207229
</BoxRow>

src/web/src/utils/init-widget.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ function injectStylesheets(): void {
7070
href: "https://fonts.googleapis.com/css2?family=Inter:wght@100..900&family=IBM+Plex+Mono:wght@400;500;600;700&display=swap",
7171
});
7272

73+
// Inject base font size so 1rem = 10px in the iframe
74+
injectElement("apify-base-font-size", "style", {
75+
textContent: `html, :root { font-size: 10px !important; }`,
76+
});
77+
7378
// Inject CSS variables
7479
injectElement("apify-css-variables", "style", {
7580
textContent: `:root {${cssColorsVariablesLight}}`,

0 commit comments

Comments
 (0)