Commit f8df5d99 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Convert Tutorial component to tailwind

Tutorial needed a little adjustment after preflight enabled, so it has
been fully converted to tailwind at this time.
parent 241a3053
import { Icon } from '@hypothesis/frontend-shared'; import { Icon, Link } from '@hypothesis/frontend-shared';
import classnames from 'classnames';
import { isThirdPartyService } from '../helpers/is-third-party-service'; import { isThirdPartyService } from '../helpers/is-third-party-service';
import { withServices } from '../service-context'; import { withServices } from '../service-context';
...@@ -14,10 +15,13 @@ import { withServices } from '../service-context'; ...@@ -14,10 +15,13 @@ import { withServices } from '../service-context';
*/ */
function TutorialInstruction({ commandName, iconName }) { function TutorialInstruction({ commandName, iconName }) {
return ( return (
<span className="Tutorial__instruction"> <span className="whitespace-nowrap">
<Icon <Icon
name={iconName} name={iconName}
classes="hyp-u-margin--right--1 hyp-u-color--grey-6 u-inline Tutorial__icon" classes={classnames(
'mx-1 -mt-1', // Give horizontal space; pull up top margin a little
'text-color-text-light inline'
)}
/> />
<em>{commandName}</em> <em>{commandName}</em>
</span> </span>
...@@ -30,40 +34,38 @@ function TutorialInstruction({ commandName, iconName }) { ...@@ -30,40 +34,38 @@ function TutorialInstruction({ commandName, iconName }) {
function Tutorial({ settings }) { function Tutorial({ settings }) {
const canCreatePrivateGroups = !isThirdPartyService(settings); const canCreatePrivateGroups = !isThirdPartyService(settings);
return ( return (
<ol className="Tutorial__list"> <ol className="list-decimal pl-10 space-y-2">
<li className="Tutorial__item"> <li>
To create an annotation, select text and then select the{' '} To create an annotation, select text and then select the{' '}
<TutorialInstruction iconName="annotate" commandName="Annotate" />{' '} <TutorialInstruction iconName="annotate" commandName="Annotate" />{' '}
button. button.
</li> </li>
<li className="Tutorial__item"> <li>
To create a highlight ( To create a highlight (
<a <Link
href="https://web.hypothes.is/help/why-are-highlights-private-by-default/" href="https://web.hypothes.is/help/why-are-highlights-private-by-default/"
target="_blank" target="_blank"
rel="noopener noreferrer"
> >
visible only to you visible only to you
</a> </Link>
), select text and then select the{' '} ), select text and then select the{' '}
<TutorialInstruction iconName="highlight" commandName="Highlight" />{' '} <TutorialInstruction iconName="highlight" commandName="Highlight" />{' '}
button. button.
</li> </li>
{canCreatePrivateGroups && ( {canCreatePrivateGroups && (
<li className="Tutorial__item"> <li>
To annotate in a private group, select the group from the groups To annotate in a private group, select the group from the groups
dropdown. Don&apos;t see your group? Ask the group creator to send a{' '} dropdown. Don&apos;t see your group? Ask the group creator to send a{' '}
<a <Link
href="https://web.hypothes.is/help/how-to-join-a-private-group/" href="https://web.hypothes.is/help/how-to-join-a-private-group/"
target="_blank" target="_blank"
rel="noopener noreferrer"
> >
join link join link
</a> </Link>
). ).
</li> </li>
)} )}
<li className="Tutorial__item"> <li>
To reply to an annotation, select the{' '} To reply to an annotation, select the{' '}
<TutorialInstruction iconName="reply" commandName="Reply" /> button. <TutorialInstruction iconName="reply" commandName="Reply" /> button.
</li> </li>
......
@use '../../variables' as var;
@use '../../mixins/layout';
@use '../../mixins/utils';
.Tutorial {
&__list {
@include layout.vertical-rhythm(var.$layout-space--xsmall);
}
&__icon {
margin-bottom: -1px; // Pull the icon a little toward the baseline
}
&__instruction {
white-space: nowrap; // Keep icons and their associated names on the same line
}
}
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
@use './components/ThreadList'; @use './components/ThreadList';
@use './components/ToastMessages'; @use './components/ToastMessages';
@use './components/TopBar'; @use './components/TopBar';
@use './components/Tutorial';
@use './components/VersionInfo'; @use './components/VersionInfo';
// Make the shared package utility styles available // Make the shared package utility styles available
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment