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

Update arrow icons to follow same pattern #920

Open
wants to merge 5 commits into
base: trunk
Choose a base branch
from
Open
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
5 changes: 3 additions & 2 deletions src/components/content-tab-assistant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import {
} from '@wordpress/components';
import { createInterpolateElement } from '@wordpress/element';
import { __, _n, sprintf } from '@wordpress/i18n';
import { Icon, external } from '@wordpress/icons';
import { Icon } from '@wordpress/icons';
import { useI18n } from '@wordpress/react-i18n';
import React, { useState, useEffect, useRef, memo, useCallback, useMemo } from 'react';
import ClearHistoryReminder from 'src/components/ai-clear-history-reminder';
import { AIInput } from 'src/components/ai-input';
import { ArrowIcon } from 'src/components/arrow-icon';
import { MessageThinking } from 'src/components/assistant-thinking';
import Button from 'src/components/button';
import { ChatMessage, MarkDownWithCode } from 'src/components/chat-message';
Expand Down Expand Up @@ -320,7 +321,7 @@ const UnauthenticatedView = ( { onAuthenticate }: { onAuthenticate: () => void }
</div>
<Button variant="primary" onClick={ onAuthenticate }>
{ __( 'Log in to WordPress.com' ) }
<Icon className="ltr:ml-1 rtl:mr-1 rtl:scale-x-[-1]" icon={ external } size={ 21 } />
<ArrowIcon />
</Button>
</ChatMessage>
);
Expand Down
7 changes: 2 additions & 5 deletions src/components/content-tab-overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
} from '@wordpress/icons';
import { useI18n } from '@wordpress/react-i18n';
import { useState } from 'react';
import { ArrowIcon } from 'src/components/arrow-icon';
import { ButtonsSection, ButtonsSectionProps } from 'src/components/buttons-section';
import { Tooltip } from 'src/components/tooltip';
import { useCheckInstalledApps } from 'src/hooks/use-check-installed-apps';
Expand Down Expand Up @@ -259,11 +260,7 @@ export function ContentTabOverview( { selectedSite }: ContentTabOverviewProps )
}
>
{ __( 'Open site' ) }
<Icon
icon={ external }
className="ltr:ml-0.5 rtl:mr-0.5 rtl:scale-x-[-1] fill-a8c-blueberry"
size={ 14 }
/>
<ArrowIcon />
</div>
{ thumbnailImage }
</button>
Expand Down
5 changes: 3 additions & 2 deletions src/components/content-tab-previews.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { createInterpolateElement } from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';
import { check, external, Icon } from '@wordpress/icons';
import { check, Icon } from '@wordpress/icons';
import { useI18n } from '@wordpress/react-i18n';
import { PropsWithChildren } from 'react';
import { ArrowIcon } from 'src/components/arrow-icon';
import Button from 'src/components/button';
import offlineIcon from 'src/components/offline-icon';
import { ScreenshotDemoSite } from 'src/components/screenshot-demo-site';
Expand Down Expand Up @@ -103,7 +104,7 @@ function NoAuth( { selectedSite }: React.ComponentProps< typeof EmptyGeneric > )
} }
>
{ __( 'Log in to WordPress.com' ) }
<Icon className="ltr:ml-1 rtl:mr-1 rtl:scale-x-[-1]" icon={ external } size={ 21 } />
<ArrowIcon />
</Button>
</Tooltip>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/content-tab-snapshots.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Spinner } from '@wordpress/components';
import { createInterpolateElement } from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';
import { Icon, check, external } from '@wordpress/icons';
import { Icon, check } from '@wordpress/icons';
import { useI18n } from '@wordpress/react-i18n';
import { PropsWithChildren, useEffect } from 'react';
import { ArrowIcon } from 'src/components/arrow-icon';
Expand Down Expand Up @@ -376,7 +376,7 @@ function NoAuth( { selectedSite }: React.ComponentProps< typeof EmptyGeneric > )
} }
>
{ __( 'Log in to WordPress.com' ) }
<Icon className="ltr:ml-1 rtl:mr-1 rtl:scale-x-[-1]" icon={ external } size={ 21 } />
<ArrowIcon />
</Button>
</Tooltip>
</div>
Expand Down
14 changes: 3 additions & 11 deletions src/components/header.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Icon, external } from '@wordpress/icons';
import { useI18n } from '@wordpress/react-i18n';
import { ArrowIcon } from 'src/components/arrow-icon';
import Button from 'src/components/button';
import { SiteManagementActions } from 'src/components/site-management-actions';
import { useSiteDetails } from 'src/hooks/use-site-details';
Expand All @@ -26,11 +26,7 @@ export default function Header() {
variant="link"
>
{ __( 'WP admin' ) }
<Icon
icon={ external }
className="ltr:ml-0.5 rtl:mr-0.5 rtl:scale-x-[-1]"
size={ 14 }
/>
<ArrowIcon />
</Button>
<Button
disabled={ ! site.running }
Expand All @@ -42,11 +38,7 @@ export default function Header() {
// translators: "Open site" refers to the action, like "to open site"
__( 'Open site' )
}
<Icon
className="ltr:ml-0.5 rtl:mr-0.5 rtl:scale-x-[-1]"
icon={ external }
size={ 14 }
/>
<ArrowIcon />
</Button>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/tests/content-tab-assistant.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,11 @@ describe( 'ContentTabAssistant', () => {
render( <ContextWrapper selectedSite={ runningSite } /> );

await waitFor( () => {
const loginButton = screen.getByRole( 'button', { name: 'Log in to WordPress.com' } );
const loginButton = screen.getByRole( 'button', { name: 'Log in to WordPress.com' } );
expect( loginButton ).toBeInTheDocument();
} );

const loginButton = screen.getByRole( 'button', { name: 'Log in to WordPress.com' } );
const loginButton = screen.getByRole( 'button', { name: 'Log in to WordPress.com' } );
fireEvent.click( loginButton );
expect( authenticate ).toHaveBeenCalledTimes( 1 );
} );
Expand Down
4 changes: 2 additions & 2 deletions src/components/tests/content-tab-snapshots.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe( 'ContentTabSnapshots', () => {
( useOffline as jest.Mock ).mockReturnValue( false );

render( <ContentTabSnapshots selectedSite={ selectedSite } /> );
const loginButton = screen.getByRole( 'button', { name: 'Log in to WordPress.com' } );
const loginButton = screen.getByRole( 'button', { name: 'Log in to WordPress.com' } );
expect( loginButton ).toBeVisible();
await user.click( loginButton );
expect( authenticate ).toHaveBeenCalledTimes( 1 );
Expand Down Expand Up @@ -378,7 +378,7 @@ describe( 'ContentTabSnapshots', () => {
( useAuth as jest.Mock ).mockReturnValue( { isAuthenticated: false } );
render( <ContentTabSnapshots selectedSite={ selectedSite } /> );

const loginButton = screen.getByRole( 'button', { name: 'Log in to WordPress.com' } );
const loginButton = screen.getByRole( 'button', { name: 'Log in to WordPress.com' } );
expect( loginButton ).toHaveAttribute( 'aria-disabled', 'true' );
fireEvent.mouseOver( loginButton );
expect(
Expand Down
Loading