basic export repository link in settings (#2641)
* basic export repository link in settings Absolutely no prior React experience, and limited TypeScript, so probably doing all kinds of things wrong! I tried to make it a download button instead of link but that didn't work. There is probably a safer way to construct the URL string. I think having the download open in the browser is reasonable, as opposed to an in-app save flow in mobile. But i'm not sure. * Remove appview proxy toggle * Move Settings screen to a subfolder * Add support for the download attribute on links in web * Rewrite ExportRepository modal using ALF * Mobile ui tweaks --------- Co-authored-by: Paul Frazee <pfrazee@gmail.com>
This commit is contained in:
parent
b308d7e65d
commit
d7a3246fe3
5 changed files with 161 additions and 96 deletions
|
@ -148,6 +148,10 @@ export type LinkProps = Omit<BaseLinkProps, 'warnOnMismatchingTextChild'> &
|
|||
* Label for a11y. Defaults to the href.
|
||||
*/
|
||||
label?: string
|
||||
/**
|
||||
* Web-only attribute. Sets `download` attr on web.
|
||||
*/
|
||||
download?: string
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -158,7 +162,13 @@ export type LinkProps = Omit<BaseLinkProps, 'warnOnMismatchingTextChild'> &
|
|||
* Intended to behave as a web anchor tag. For more complex routing, use a
|
||||
* `Button`.
|
||||
*/
|
||||
export function Link({children, to, action = 'push', ...rest}: LinkProps) {
|
||||
export function Link({
|
||||
children,
|
||||
to,
|
||||
action = 'push',
|
||||
download,
|
||||
...rest
|
||||
}: LinkProps) {
|
||||
const {href, isExternal, onPress} = useLink({
|
||||
to,
|
||||
displayText: typeof children === 'string' ? children : '',
|
||||
|
@ -177,6 +187,7 @@ export function Link({children, to, action = 'push', ...rest}: LinkProps) {
|
|||
hrefAttrs: {
|
||||
target: isExternal ? 'blank' : undefined,
|
||||
rel: isExternal ? 'noopener noreferrer' : undefined,
|
||||
download,
|
||||
},
|
||||
dataSet: {
|
||||
// default to no underline, apply this ourselves
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue