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

Use theme to define color on links in Document Handler #1563

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,10 @@ export const CustomLink = ({ aTag, localObserver, bottomMargin }) => {
);
};

const getExternalLink = (externalLink) => {
const GetExternalLink = (externalLink) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why getExternalLinks => GetExternalLink?

// Grab the theme to determine current light/dark mode
const theme = useTheme();

return (
<Button
startIcon={
Expand All @@ -766,7 +769,10 @@ export const CustomLink = ({ aTag, localObserver, bottomMargin }) => {
}
sx={{
padding: 0,
color: "info.main",
color:
theme.palette.mode === "dark"
? theme.palette.info.dark
: theme.palette.info.main,
".MuiButton-startIcon": {
marginLeft: 0,
},
Expand All @@ -782,7 +788,10 @@ export const CustomLink = ({ aTag, localObserver, bottomMargin }) => {
);
};

const getMapLink = (aTag, mapLinkOrg) => {
const GetMapLink = (aTag, mapLinkOrg) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why getMapLink => GetMapLink?

// Grab the theme to determine current light/dark mode
const theme = useTheme();

// Attempt to safely URI Decode the supplied string. If
// it fails, use it as-is.
// The reason we want probably want to decode is that the
Expand All @@ -806,7 +815,10 @@ export const CustomLink = ({ aTag, localObserver, bottomMargin }) => {
}
sx={{
padding: 0,
color: "info.main",
color:
theme.palette.mode === "dark"
? theme.palette.info.dark
: theme.palette.info.main,
...(bottomMargin && { marginBottom: 1 }),
".MuiButton-startIcon": {
marginLeft: 0,
Expand All @@ -825,7 +837,10 @@ export const CustomLink = ({ aTag, localObserver, bottomMargin }) => {
);
};

const getDocumentLink = (headerIdentifier, documentLink, isPrintMode) => {
const GetDocumentLink = (headerIdentifier, documentLink, isPrintMode) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why getDocumentLink => GetDocumentLink?

// Grab the theme to determine current light/dark mode
const theme = useTheme();

return (
<Button
startIcon={
Expand All @@ -837,7 +852,10 @@ export const CustomLink = ({ aTag, localObserver, bottomMargin }) => {
}
sx={{
padding: 0,
color: "info.main",
color:
theme.palette.mode === "dark"
? theme.palette.info.dark
: theme.palette.info.main,
".MuiButton-startIcon": {
marginLeft: 0,
},
Expand All @@ -863,15 +881,15 @@ export const CustomLink = ({ aTag, localObserver, bottomMargin }) => {

if (documentLink) {
const isPrintMode = Boolean(aTag.attributes.printMode);
return getDocumentLink(headerIdentifier, documentLink, isPrintMode);
return GetDocumentLink(headerIdentifier, documentLink, isPrintMode);
}

if (mapLink) {
return getMapLink(aTag, mapLink, localObserver);
return GetMapLink(aTag, mapLink, localObserver);
}

if (externalLink) {
return getExternalLink(externalLink);
return GetExternalLink(externalLink);
}

if (hoverLink) {
Expand Down