Skip to content

Commit 6fb9f68

Browse files
committed
remove training tooltip
1 parent 9d35f6c commit 6fb9f68

23 files changed

+243
-920
lines changed

package-lock.json

-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@
133133
"react-stickynode": "^2.1.1",
134134
"react-tag-input": "^6.4.1",
135135
"react-through": "^1.1.1",
136-
"react-toggle": "^4.1.1",
137136
"react-transition-group": "^2.5.1",
138137
"redux": "^4.0.4",
139138
"redux-devtools-extension": "^2.13.7",
@@ -179,7 +178,6 @@
179178
"@types/react-select": "^3.0.2",
180179
"@types/react-stickynode": "^1.4.0",
181180
"@types/react-tag-input": "^6.1.2",
182-
"@types/react-toggle": "^4.0.2",
183181
"@types/react-transition-group": "^2.0.15",
184182
"@types/storybook__react": "^4.0.1",
185183
"@types/uuid": "3.4.9",

src/@store/ui/uiActions.ts

-36
Original file line numberDiff line numberDiff line change
@@ -45,39 +45,3 @@ export function toggleMenu() {
4545
dispatch({ type: _getState().ui.menuOpen ? ActionTypes.HIDE_MENU : ActionTypes.SHOW_MENU });
4646
};
4747
}
48-
49-
export function enableTrainingTooltipsOnHover() {
50-
return (dispatch: Redux.Dispatch<any, any>, _getState: () => IRootState) => {
51-
dispatch({ type: ActionTypes.ENABLE_TRAINING_TOOLTIPS_ON_HOVER });
52-
};
53-
}
54-
55-
export function disableTrainingTooltipsOnHover() {
56-
return (dispatch: Redux.Dispatch<any, any>, _getState: () => IRootState) => {
57-
dispatch({ type: ActionTypes.DISABLE_TRAINING_TOOLTIPS_ON_HOVER });
58-
};
59-
}
60-
61-
export function toggleTrainingTooltipsOnHover() {
62-
return (dispatch: Redux.Dispatch<any, any>, _getState: () => IRootState) => {
63-
dispatch({ type: _getState().ui.trainingTooltipsOnHover ? ActionTypes.DISABLE_TRAINING_TOOLTIPS_ON_HOVER : ActionTypes.ENABLE_TRAINING_TOOLTIPS_ON_HOVER });
64-
};
65-
}
66-
67-
export function enableTrainingTooltipsShowAll() {
68-
return (dispatch: Redux.Dispatch<any, any>, _getState: () => IRootState) => {
69-
dispatch({ type: ActionTypes.ENABLE_TRAINING_TOOLTIPS_SHOW_ALL });
70-
};
71-
}
72-
73-
export function disableTrainingTooltipsShowAll() {
74-
return (dispatch: Redux.Dispatch<any, any>, _getState: () => IRootState) => {
75-
dispatch({ type: ActionTypes.DISABLE_TRAINING_TOOLTIPS_SHOW_ALL });
76-
};
77-
}
78-
79-
export function toggleTrainingTooltipsShowAll() {
80-
return (dispatch: Redux.Dispatch<any, any>, _getState: () => IRootState) => {
81-
dispatch({ type: _getState().ui.trainingTooltipsShowAll ? ActionTypes.DISABLE_TRAINING_TOOLTIPS_SHOW_ALL : ActionTypes.ENABLE_TRAINING_TOOLTIPS_SHOW_ALL });
82-
};
83-
}

src/@store/ui/uiReducer.ts

-16
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,13 @@ export interface IUIState {
1818
simpleMessageOpen: boolean;
1919
simpleMessageOptions: ISimpleMessagePopupProps;
2020
tourVisible: boolean;
21-
trainingTooltipsOnHover: boolean;
22-
trainingTooltipsShowAll: boolean;
2321
}
2422

2523
const initialState: IUIState = {
2624
menuOpen: false,
2725
simpleMessageOpen: false,
2826
simpleMessageOptions: { body: "" },
2927
tourVisible: false,
30-
trainingTooltipsOnHover: true,
31-
trainingTooltipsShowAll: false,
3228
};
3329

3430
const uiReducer = (state = initialState, action: any) => {
@@ -52,18 +48,6 @@ const uiReducer = (state = initialState, action: any) => {
5248
case ActionTypes.HIDE_SIMPLE_MESSAGE:
5349
return { ...state, simpleMessageOpen: false };
5450

55-
case ActionTypes.ENABLE_TRAINING_TOOLTIPS_ON_HOVER:
56-
return { ...state, trainingTooltipsOnHover: true };
57-
58-
case ActionTypes.DISABLE_TRAINING_TOOLTIPS_ON_HOVER:
59-
return { ...state, trainingTooltipsOnHover: false };
60-
61-
case ActionTypes.ENABLE_TRAINING_TOOLTIPS_SHOW_ALL:
62-
return { ...state, trainingTooltipsShowAll: true };
63-
64-
case ActionTypes.DISABLE_TRAINING_TOOLTIPS_SHOW_ALL:
65-
return { ...state, trainingTooltipsShowAll: false };
66-
6751
default: {
6852
return state;
6953
}

src/components/Dao/DaoSchemesPage.tsx

+12-16
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { CompetitionScheme, IDAOState, ISchemeState, Scheme } from "@daostack/ar
22
import { enableWalletProvider } from "arc";
33
import classNames from "classnames";
44
import Loading from "components/Shared/Loading";
5-
import TrainingTooltip from "components/Shared/TrainingTooltip";
65
import withSubscription, { ISubscriptionProps } from "components/Shared/withSubscription";
76
import UnknownSchemeCard from "components/Dao/UnknownSchemeCard";
87
import Analytics from "lib/analytics";
@@ -115,21 +114,18 @@ class DaoSchemesPage extends React.Component<IProps, null> {
115114

116115
<Sticky enabled top={50} innerZ={10000}>
117116
<h1>Plugins</h1>
118-
{ schemeManager ?
119-
<TrainingTooltip placement="topLeft" overlay={"A small amount of ETH is necessary to submit a proposal in order to pay gas costs"}>
120-
<a className={
121-
classNames({
122-
[css.addPluginButton]: true,
123-
[css.disabled]: !schemeManagerActive,
124-
})}
125-
data-test-id="createProposal"
126-
href="#!"
127-
onClick={schemeManagerActive ? this.handleNewProposal(schemeManager.id) : null}
128-
>
129-
Add a Plugin
130-
</a>
131-
</TrainingTooltip>
132-
: ""}
117+
{Boolean(schemeManager) &&
118+
<a className={
119+
classNames({
120+
[css.addPluginButton]: true,
121+
[css.disabled]: !schemeManagerActive,
122+
})}
123+
data-test-id="createProposal"
124+
href="#!"
125+
onClick={schemeManagerActive ? this.handleNewProposal(schemeManager.id) : null}
126+
>
127+
Add a Plugin
128+
</a>}
133129
</Sticky>
134130
{(allKnownSchemes.length + unknownSchemes.length) === 0
135131
? <div>

src/components/Dao/ProposalSchemeCard.tsx

+1-18
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { schemeName } from "lib/schemeUtils";
88
import * as React from "react";
99
import { Link } from "react-router-dom";
1010
import { combineLatest } from "rxjs";
11-
import TrainingTooltip from "components/Shared/TrainingTooltip";
1211
import * as css from "./SchemeCard.scss";
1312

1413
interface IExternalProps {
@@ -30,26 +29,10 @@ const ProposalSchemeCard = (props: IProps) => {
3029
const proposalsHTML = proposals.map((proposal: Proposal) => <SubscribedProposalDetail key={proposal.id} proposal={proposal} dao={dao} />);
3130
const headerHtml = <h2>{schemeName(schemeState, "[Unknown]")}</h2>;
3231

33-
let trainingTooltipMessage: string;
34-
35-
switch (schemeState.name) {
36-
case "ContributionReward":
37-
case "ContributionRewardExt":
38-
trainingTooltipMessage = "Use this scheme to reward users (rep and/or funds) for their contributions to the DAO";
39-
break;
40-
case "SchemeRegistrar":
41-
trainingTooltipMessage = "Use this scheme to install, remove or edit the schemes of the DAO";
42-
break;
43-
}
44-
4532
return (
4633
<div className={css.wrapper} data-test-id={`schemeCard-${schemeState.name}`}>
4734
<Link className={css.headerLink} to={`/dao/${dao.address}/scheme/${schemeState.id}`}>
48-
{ trainingTooltipMessage ?
49-
<TrainingTooltip placement="topLeft" overlay={trainingTooltipMessage}>
50-
{headerHtml}
51-
</TrainingTooltip> : headerHtml
52-
}
35+
{headerHtml}
5336
<div>
5437
<b>{schemeState.numberOfBoostedProposals}</b> <span>Boosted</span> <b>{schemeState.numberOfPreBoostedProposals}</b> <span>Pending Boosting</span> <b>{schemeState.numberOfQueuedProposals}</b> <span>Regular</span>
5538
</div>

src/components/Proposal/ActionButton.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959
/**
6060
* Container for Tooltip child for when you need the child to show a tooltip even when disabled.
61-
* Better would be to create a Tooltip component (like we did with TrainingTooltip) that
61+
* Better would be to create a Tooltip component that
6262
* does this automatically for all Tooltips.
6363
*/
6464
div.tooltipWhenDisabledContainer {

src/components/Proposal/Create/SchemeForms/CreateContributionRewardProposal.tsx

+24-49
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { ErrorMessage, Field, Form, Formik, FormikProps } from "formik";
77
import withSubscription, { ISubscriptionProps } from "components/Shared/withSubscription";
88
import UserSearchField from "components/Shared/UserSearchField";
99
import TagsSelector from "components/Proposal/Create/SchemeForms/TagsSelector";
10-
import TrainingTooltip from "components/Shared/TrainingTooltip";
1110
import Analytics from "lib/analytics";
1211
import { baseTokenName, supportedTokens, toBaseUnit, tokenDetails, toWei, isValidUrl, isAddress, getArcByDAOAddress, getNetworkByDAOAddress } from "lib/util";
1312
import { showNotification, NotificationStatus } from "@store/notifications/notifications.reducer";
@@ -107,8 +106,6 @@ class CreateContributionReward extends React.Component<IProps, IStateProps> {
107106
};
108107
}
109108

110-
private fnDescription = (<span>Short description of the proposal.<ul><li>What are you proposing to do?</li><li>Why is it important?</li><li>How much will it cost the DAO?</li><li>When do you plan to deliver the work?</li></ul></span>);
111-
112109
public handleSubmit = async (values: IFormValues, { setSubmitting }: any ): Promise<void> => {
113110
if (!await enableWalletProvider({ showNotification: this.props.showNotification }, getNetworkByDAOAddress(this.props.daoAvatarAddress))) { return; }
114111

@@ -234,13 +231,11 @@ class CreateContributionReward extends React.Component<IProps, IStateProps> {
234231
}: FormikProps<IFormValues>) =>
235232
<Form noValidate>
236233
<div className={css.description}>This proposal can send eth / erc20 token, mint new DAO tokens ({dao.tokenSymbol}) and mint / slash reputation in the DAO. Each proposal can have one of each of these actions. e.g. 100 rep for completing a project + 0.05 ETH for covering expenses.</div>
237-
<TrainingTooltip overlay="The title is the header of the proposal card and will be the first visible information about your proposal" placement="right">
238-
<label htmlFor="titleInput">
239-
<div className={css.requiredMarker}>*</div>
234+
<label htmlFor="titleInput">
235+
<div className={css.requiredMarker}>*</div>
240236
Title
241-
<ErrorMessage name="title">{(msg: string) => <span className={css.errorMessage}>{msg}</span>}</ErrorMessage>
242-
</label>
243-
</TrainingTooltip>
237+
<ErrorMessage name="title">{(msg: string) => <span className={css.errorMessage}>{msg}</span>}</ErrorMessage>
238+
</label>
244239
<Field
245240
autoFocus
246241
id="titleInput"
@@ -250,16 +245,13 @@ class CreateContributionReward extends React.Component<IProps, IStateProps> {
250245
type="text"
251246
className={touched.title && errors.title ? css.error : null}
252247
/>
253-
254-
<TrainingTooltip overlay={this.fnDescription} placement="right">
255-
<label htmlFor="descriptionInput">
256-
<div className={css.proposalDescriptionLabelText}>
257-
<div className={css.requiredMarker}>*</div>
258-
<div className={css.body}>Description</div><HelpButton text={HelpButton.helpTextProposalDescription} />
259-
</div>
260-
<ErrorMessage name="description">{(msg: string) => <span className={css.errorMessage}>{msg}</span>}</ErrorMessage>
261-
</label>
262-
</TrainingTooltip>
248+
<label htmlFor="descriptionInput">
249+
<div className={css.proposalDescriptionLabelText}>
250+
<div className={css.requiredMarker}>*</div>
251+
<div className={css.body}>Description</div><HelpButton text={HelpButton.helpTextProposalDescription} />
252+
</div>
253+
<ErrorMessage name="description">{(msg: string) => <span className={css.errorMessage}>{msg}</span>}</ErrorMessage>
254+
</label>
263255
<Field
264256
component={MarkdownField}
265257
onChange={(value: any) => { setFieldValue("description", value); }}
@@ -268,23 +260,15 @@ class CreateContributionReward extends React.Component<IProps, IStateProps> {
268260
name="description"
269261
className={touched.description && errors.description ? css.error : null}
270262
/>
271-
272-
<TrainingTooltip overlay="Add some tags to give context about your proposal e.g. idea, signal, bounty, research, etc" placement="right">
273-
<label className={css.tagSelectorLabel}>
274-
Tags
275-
</label>
276-
</TrainingTooltip>
277-
263+
<label className={css.tagSelectorLabel}>Tags</label>
278264
<div className={css.tagSelectorContainer}>
279265
<TagsSelector onChange={this.onTagsChange()} tags={this.state.tags} arc={getArcByDAOAddress(dao.address)}></TagsSelector>
280266
</div>
281267

282-
<TrainingTooltip overlay="Link to the fully detailed description of your proposal" placement="right">
283-
<label htmlFor="urlInput">
268+
<label htmlFor="urlInput">
284269
URL
285-
<ErrorMessage name="url">{(msg: string) => <span className={css.errorMessage}>{msg}</span>}</ErrorMessage>
286-
</label>
287-
</TrainingTooltip>
270+
<ErrorMessage name="url">{(msg: string) => <span className={css.errorMessage}>{msg}</span>}</ErrorMessage>
271+
</label>
288272
<Field
289273
id="urlInput"
290274
maxLength={120}
@@ -295,12 +279,11 @@ class CreateContributionReward extends React.Component<IProps, IStateProps> {
295279
/>
296280

297281
<div>
298-
<TrainingTooltip overlay="Ethereum Address or Alchemy Username to receive rewards, if not you" placement="right">
299-
<label htmlFor="beneficiary">
300-
Recipient, if not you
301-
<ErrorMessage name="beneficiary">{(msg: string) => <span className={css.errorMessage}>{msg}</span>}</ErrorMessage>
302-
</label>
303-
</TrainingTooltip>
282+
<label htmlFor="beneficiary">
283+
Recipient, if not you
284+
<ErrorMessage name="beneficiary">{(msg: string) => <span className={css.errorMessage}>{msg}</span>}</ErrorMessage>
285+
</label>
286+
304287
<UserSearchField
305288
daoAvatarAddress={daoAvatarAddress}
306289
name="beneficiary"
@@ -395,19 +378,11 @@ class CreateContributionReward extends React.Component<IProps, IStateProps> {
395378
}
396379
</div>
397380
<div className={css.createProposalActions}>
398-
<TrainingTooltip overlay="Export proposal" placement="top">
399-
<button id="export-proposal" className={css.exportProposal} type="button" onClick={() => this.exportFormValues(values)}>
400-
<img src="/assets/images/Icon/share-blue.svg" />
401-
</button>
402-
</TrainingTooltip>
403-
<button className={css.exitProposalCreation} type="button" onClick={handleClose}>
404-
Cancel
381+
<button id="export-proposal" className={css.exportProposal} type="button" onClick={() => this.exportFormValues(values)}>
382+
<img src="/assets/images/Icon/share-blue.svg" />
405383
</button>
406-
<TrainingTooltip overlay="Once the proposal is submitted it cannot be edited or deleted" placement="top">
407-
<button className={css.submitProposal} type="submit" disabled={isSubmitting}>
408-
Submit proposal
409-
</button>
410-
</TrainingTooltip>
384+
<button className={css.exitProposalCreation} type="button" onClick={handleClose}>Cancel</button>
385+
<button className={css.submitProposal} type="submit" disabled={isSubmitting}>Submit proposal</button>
411386
</div>
412387
</Form>
413388
}

0 commit comments

Comments
 (0)