From 2a9e3549b5d45717c38bdcc43a994cb826dde576 Mon Sep 17 00:00:00 2001 From: Paul Bienkowski Date: Wed, 2 Mar 2022 19:48:02 +0100 Subject: [PATCH] Fix track download dropdown appearing for non-authors, and update tooltip --- frontend/src/pages/TrackPage/TrackActions.tsx | 53 +++++++++---------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/frontend/src/pages/TrackPage/TrackActions.tsx b/frontend/src/pages/TrackPage/TrackActions.tsx index 19a8da5..3c14e20 100644 --- a/frontend/src/pages/TrackPage/TrackActions.tsx +++ b/frontend/src/pages/TrackPage/TrackActions.tsx @@ -5,39 +5,36 @@ import {Icon, Popup, Button, Dropdown} from 'semantic-ui-react' export default function TrackActions({slug, isAuthor, onDownload}) { return ( <> - {isAuthor ? ( - - - -

Only you, the author of this track, can download the original file.

-

- This is the file as it was uploaded to the server, without modifications, and it can be used with - other tools. Exporting to other formats, and downloading modified files, will be implemented soon. -

- - } - trigger={ onDownload('original.csv')} />} - /> - onDownload('track.gpx')} /> -
-
- ) : ( - <> - - Only the author of this track can download the original file.

} - trigger={} - /> - - )} - {isAuthor && ( )} + + + + onDownload('original.csv')} disabled={!isAuthor} /> + onDownload('track.gpx')} /> + + + + } + offset={[12, 0]} + content={ + isAuthor ? ( + <> +

Only you, the author of this track, can download the original file.

+

+ This is the file as it was uploaded to the server, without modifications, and it can be used with other + tools. +

+ + ) : ( +

Only the author of this track can download the original file.

+ ) + } + /> ) }