Skip to content

Commit

Permalink
changed tooltip content
Browse files Browse the repository at this point in the history
  • Loading branch information
agnieszkajarosikloj committed Feb 6, 2023
1 parent 53b2291 commit 30abc95
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
4 changes: 4 additions & 0 deletions src/modules/core/components/Popover/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ interface Props {

/** Set the open state from outside */
isOpen?: boolean;
interactive?: boolean;
}

const Tooltip = ({
Expand All @@ -39,6 +40,7 @@ const Tooltip = ({
showArrow = true,
trigger = 'hover',
isOpen,
interactive = false,
}: Props) => {
const {
getArrowProps,
Expand All @@ -52,6 +54,8 @@ const Tooltip = ({
placement,
trigger: content ? trigger : null,
visible: isOpen,
delayHide: interactive ? 200 : 0,
interactive,
},
popperOptions,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@ import { MessageDescriptor, FormattedMessage } from 'react-intl';

import Icon from '~core/Icon';
import { Tooltip } from '~core/Popover';
import { SimpleMessageValues } from '~types/index';
import { UniversalMessageValues } from '~types/index';

const displayName = 'QuestionMarkTooltip';

interface Props {
tooltipText: string | MessageDescriptor;
tooltipTextValues?: SimpleMessageValues;
tooltipTextValues?: UniversalMessageValues;
/** Options to pass to the underlying PopperJS element. See here for more: https://popper.js.org/docs/v2/constructors/#options. */
tooltipPopperOptions?: PopperOptions;
className?: string;
tooltipClassName?: string;
iconTitle?: string;
showArrow?: boolean;
invertedIcon?: boolean;
interactive?: boolean;
}

const QuestionMarkTooltip = ({
Expand All @@ -39,6 +40,7 @@ const QuestionMarkTooltip = ({
className,
showArrow,
invertedIcon,
interactive,
}: Props) => {
return (
<>
Expand All @@ -55,6 +57,7 @@ const QuestionMarkTooltip = ({
trigger="hover"
showArrow={showArrow}
popperOptions={tooltipPopperOptions}
interactive={interactive}
>
<div className={className}>
<Icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ValuesType } from '~pages/IncorporationPage/types';
import UserAvatar from '~core/UserAvatar';
import UserMention from '~core/UserMention';
import Tag from '~core/Tag';
import Link from '~core/Link';

import { SignOption, VerificationStatus } from '../constants';

Expand All @@ -19,7 +20,7 @@ export const MSG = defineMessages({
},
protectorsTooltip: {
id: `dashboard.Incorporation.IncorporationForm.LockedProtectors.protectorsTooltip`,
defaultMessage: `A Protector's role in a DAO legal corporation is to ratify the decisions of the DAO. Their purpose is to act on behalf of the DAO and handle legal the required administration. Learn more`,
defaultMessage: `A Protector's role in a DAO legal corporation is to ratify the decisions of the DAO. Their purpose is to act on behalf of the DAO for legal matters and any required legal administration. <a>Learn more.</a>`,
},
unverified: {
id: `dashboard.Incorporation.IncorporationForm.LockedProtectors.unverified`,
Expand All @@ -39,7 +40,7 @@ export const MSG = defineMessages({
},
mainContactTooltip: {
id: `dashboard.Incorporation.IncorporationForm.LockedProtectors.mainContactTooltip`,
defaultMessage: `The main contact is required during the incorporation process and is also required to use their delivery address details for the registration.`,
defaultMessage: `The main contact is required during the incorporation process for administration purposes.`,
},
signOptionTooltip: {
id: `dashboard.Incorporation.IncorporationForm.LockedProtectors.signOptionTooltip`,
Expand Down Expand Up @@ -76,7 +77,13 @@ const LockedProtectors = ({ formValues }: Props) => {
<div className={styles.label}>
<FormattedMessage {...MSG.protectors} />
</div>
<QuestionMarkTooltip tooltipText={MSG.protectorsTooltip} />
<QuestionMarkTooltip
tooltipText={MSG.protectorsTooltip}
tooltipTextValues={{
a: (chunks) => <Link to="/">{chunks}</Link>, // link is a mock, add redirection to the correct page
}}
interactive
/>
</div>
</div>
</FormSection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { filterUserSelection } from '~core/SingleUserPicker';
import { supRenderAvatar } from '~dashboard/ExpenditurePage/Recipient/Recipient';
import { Protector } from '~pages/IncorporationPage/types';
import Button from '~core/Button';
import Link from '~core/Link';

import Radio from '../Radio';
import { SignOption } from '../types';
Expand All @@ -28,7 +29,7 @@ export const MSG = defineMessages({
},
protectorsTooltip: {
id: `dashboard.Incorporation.IncorporationForm.Protectors.protectorsTooltip`,
defaultMessage: `A Protector's role in a DAO legal corporation is to ratify the decisions of the DAO. Their purpose is to act on behalf of the DAO and handle legal the required administration. Learn more`,
defaultMessage: `A Protector's role in a DAO legal corporation is to ratify the decisions of the DAO. Their purpose is to act on behalf of the DAO for legal matters and any required legal administration. <a>Learn more.</a>`,
},
deleteIconTitle: {
id: `dashboard.Incorporation.IncorporationForm.Protectors.deleteIconTitle`,
Expand Down Expand Up @@ -56,7 +57,7 @@ export const MSG = defineMessages({
},
mainContactTooltip: {
id: `dashboard.Incorporation.IncorporationForm.Protectors.mainContactTooltip`,
defaultMessage: `The main contact is required during the incorporation process and is also required to use their delivery address details for the registration.`,
defaultMessage: `The main contact is required during the incorporation process for administration purposes.`,
},
});

Expand Down Expand Up @@ -130,7 +131,13 @@ const Protectors = ({ colony, sidebarRef }: Props) => {
}}
/>
</div>
<QuestionMarkTooltip tooltipText={MSG.protectorsTooltip} />
<QuestionMarkTooltip
tooltipText={MSG.protectorsTooltip}
tooltipTextValues={{
a: (chunks) => <Link to="/">{chunks}</Link>, // link is a mock, add redirection to the correct page
}}
interactive
/>
</div>
<FieldArray
name="protectors"
Expand Down

0 comments on commit 30abc95

Please sign in to comment.