-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove
ReaderModal
and Introduce MaterialSecondaryLink
After the `Reader` is no longer an app, the `ReaderModal` is no longer in use and has been removed. A new component, `MaterialSecondaryLink`, has been added. It follows the same structure as `MaterialSecondaryButton` but is designed for links instead. I considered reverting the `MaterialSecondaryButton` introduced in an earlier commit, but I believe the new structure is more readable. Additionally, it may be useful for the `Player` app/component in the future. - Remove unnecessary `isFullScreen` from `Modal` With `Reader` now functioning as an app on its own page, this property is no longer required.
- Loading branch information
1 parent
dfe424b
commit ac4ac32
Showing
5 changed files
with
47 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
src/components/material/material-buttons/generic/MaterialSecondaryLink.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React, { FC } from "react"; | ||
import { ButtonSize } from "../../../../core/utils/types/button"; | ||
import LinkButton from "../../../Buttons/LinkButton"; | ||
|
||
interface MaterialSecondaryLinkProps { | ||
label: string; | ||
size: ButtonSize; | ||
url: URL; | ||
dataCy?: string; | ||
} | ||
|
||
const MaterialSecondaryLink: FC<MaterialSecondaryLinkProps> = ({ | ||
label, | ||
size, | ||
url, | ||
dataCy | ||
}) => { | ||
if (size !== "small") { | ||
return ( | ||
<LinkButton | ||
url={url} | ||
buttonType="none" | ||
variant="outline" | ||
size="large" | ||
dataCy={dataCy} | ||
> | ||
{label} | ||
</LinkButton> | ||
); | ||
} | ||
|
||
return ( | ||
<a | ||
href={url.toString()} | ||
className="link-tag text-small-caption material-manifestation-item__find capitalize-all btn-ui" | ||
data-cy={dataCy} | ||
> | ||
{label} | ||
</a> | ||
); | ||
}; | ||
|
||
export default MaterialSecondaryLink; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters