Skip to content

Commit

Permalink
Add learn more button for casual mode linking the wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayyy committed Feb 13, 2025
1 parent 57b22b6 commit 42bea31
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
4 changes: 4 additions & 0 deletions public/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,10 @@ ytd-compact-playlist-renderer .ytd-compact-playlist-renderer #video-title:not(.c
padding: 5px;
}

.cbCasualVoteDescription a {
color: inherit;
}

.casualOnboarding .cbVoteButton {
font-size: 18px;
}
Expand Down
15 changes: 13 additions & 2 deletions src/options/CasualChoiceComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react";
import { FormattedText } from "../popup/FormattedTextComponent";
import Config from "../config/config";
import { casualVoteCategories, CasualVoteCategory } from "../submission/casualVote.const";
import Config, { TitleFormatting } from "../config/config";
import { casualVoteCategories, CasualVoteCategory, casualWikiLink } from "../submission/casualVote.const";
import { ToggleOptionComponent } from "../popup/ToggleOptionComponent";

export const CasualChoiceComponent = () => {
Expand Down Expand Up @@ -61,6 +61,17 @@ export const CasualChoiceComponent = () => {
{chrome.i18n.getMessage("CasualModeDescription").split("\n").map((line, index) => (
<div key={index}>{line}</div>
))}

<a style={{textDecoration: "underline"}}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => e.stopPropagation()}
href={casualWikiLink}>
<FormattedText
langKey="LearnMore"
titleFormatting={TitleFormatting.SentenceCase}
/>
</a>
</div>

<div className="casualChoiceCategories">
Expand Down
14 changes: 14 additions & 0 deletions src/submission/CasualVoteOnboardingComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import * as React from "react";
import { FormattedText } from "../popup/FormattedTextComponent";
import { casualWikiLink } from "./casualVote.const";
import { TitleFormatting } from "../config/config";

export interface CasualVoteComponentProps {
close: () => void;
Expand Down Expand Up @@ -29,6 +31,18 @@ export const CasualVoteOnboardingComponent = (props: CasualVoteComponentProps) =
{chrome.i18n.getMessage("CasualModeDescription").split("\n").map((line, index) => (
<div key={index}>{line}</div>
))}

<div>
<a
target="_blank"
rel="noopener noreferrer"
href={casualWikiLink}>
<FormattedText
langKey="LearnMore"
titleFormatting={TitleFormatting.SentenceCase}
/>
</a>
</div>
</div>

<div className="cbVoteButtonContainer">
Expand Down
4 changes: 3 additions & 1 deletion src/submission/casualVote.const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ export const casualVoteCategories: CasualVoteCategory[] = [{
}, {
id: "other",
key: "dearrow_category_other"
}];
}];

export const casualWikiLink = "https://wiki.sponsor.ajay.app/w/DeArrow/Casual_mode";

0 comments on commit 42bea31

Please sign in to comment.