Skip to content

Commit

Permalink
fix links
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobar79 committed Apr 9, 2024
1 parent 0cf16a8 commit e7bf6d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/components/DappBrowser/BrowserTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ export const BrowserTab = React.memo(function BrowserTab({ tabId, tabIndex, inje
<ViewShot options={{ format: 'jpg' }} ref={viewShotRef}>
<View collapsable={false} style={{ height: WEBVIEW_HEIGHT, width: '100%' }}>
{isOnHomepage ? (
<Homepage tabId={tabId} />
<Homepage />
) : (
<Freeze freeze={!isActiveTab}>
<DappBrowserWebview
Expand Down
18 changes: 7 additions & 11 deletions src/components/DappBrowser/Homepage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const NUM_CARDS = 2;
const CARD_PADDING = 12;
const CARD_SIZE = (deviceUtils.dimensions.width - HORIZONTAL_PAGE_INSET * 2 - (NUM_CARDS - 1) * CARD_PADDING) / NUM_CARDS;

const Card = ({ site, showMenuButton, tabId }: { showMenuButton?: boolean; site: TrendingSite; tabId: string }) => {
const Card = ({ site, showMenuButton }: { showMenuButton?: boolean; site: TrendingSite }) => {
const { isDarkMode } = useColorMode();
const { updateActiveTabState } = useBrowserContext();

Expand All @@ -59,12 +59,8 @@ const Card = ({ site, showMenuButton, tabId }: { showMenuButton?: boolean; site:
],
};

const handleOnPress = useCallback(() => {
updateActiveTabState({ url: normalizeUrl(site.url) }, tabId);
}, [site.url, tabId, updateActiveTabState]);

return (
<ButtonPressAnimation onPress={handleOnPress} overflowMargin={100} scaleTo={0.9}>
<GestureHandlerV1Button onPressJS={() => updateActiveTabState({ url: normalizeUrl(site.url) })} scaleTo={0.9}>
<Box
background="surfacePrimary"
borderRadius={24}
Expand Down Expand Up @@ -180,7 +176,7 @@ const Card = ({ site, showMenuButton, tabId }: { showMenuButton?: boolean; site:
/>
)}
</Box>
</ButtonPressAnimation>
</GestureHandlerV1Button>
);
};

Expand All @@ -190,7 +186,7 @@ const Logo = ({ site }: { site: Omit<Site, 'timestamp'> }) => {

return (
<View style={{ width: LOGO_SIZE }}>
<GestureHandlerV1Button onPressJS={() => updateActiveTabState({ url: site.url })}>
<GestureHandlerV1Button onPressJS={() => updateActiveTabState({ url: normalizeUrl(site.url) })}>
<Stack alignHorizontal="center">
<Box>
{IS_IOS && !isEmpty(site.image) && (
Expand Down Expand Up @@ -255,7 +251,7 @@ const Logo = ({ site }: { site: Omit<Site, 'timestamp'> }) => {
);
};

export default function Homepage({ tabId }: { tabId: string }) {
export default function Homepage() {
const { isDarkMode } = useColorMode();
const { favoriteDapps } = useFavoriteDappsStore();

Expand Down Expand Up @@ -296,7 +292,7 @@ export default function Homepage({ tabId }: { tabId: string }) {
<Inset space="24px">
<Box flexDirection="row" gap={CARD_PADDING}>
{trendingDapps.map(site => (
<Card key={site.url} site={site} tabId={tabId} />
<Card key={site.url} site={site} />
))}
</Box>
</Inset>
Expand Down Expand Up @@ -336,7 +332,7 @@ export default function Homepage({ tabId }: { tabId: string }) {
</Inline>
<Inline space={{ custom: CARD_PADDING }}>
{trendingDapps.map(site => (
<Card key={site.url} site={site} showMenuButton tabId={tabId} />
<Card key={site.url} site={site} showMenuButton />
))}
</Inline>
</Stack>
Expand Down

0 comments on commit e7bf6d0

Please sign in to comment.