forked from Aspen-Discovery/aspen-discovery
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Aspen-Discovery#1789 from catsoup11789/24.05.00
LiDA updates
- Loading branch information
Showing
31 changed files
with
725 additions
and
803 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 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
51 changes: 21 additions & 30 deletions
51
code/aspen_app/src/components/Action/LoadOverDriveSample.js
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 |
---|---|---|
@@ -1,38 +1,29 @@ | ||
import React from 'react'; | ||
import { Button } from 'native-base'; | ||
import { ButtonSpinner, Button, ButtonText } from '@gluestack-ui/themed'; | ||
|
||
// custom components and helper files | ||
import {LibrarySystemContext, UserContext} from '../../context/initialContext'; | ||
import { LibrarySystemContext, ThemeContext, UserContext } from '../../context/initialContext'; | ||
import { completeAction } from '../../util/recordActions'; | ||
|
||
export const LoadOverDriveSample = (props) => { | ||
const { user } = React.useContext(UserContext); | ||
const { library } = React.useContext(LibrarySystemContext); | ||
const [loading, setLoading] = React.useState(false); | ||
const { user } = React.useContext(UserContext); | ||
const { library } = React.useContext(LibrarySystemContext); | ||
const [loading, setLoading] = React.useState(false); | ||
const { theme } = React.useContext(ThemeContext); | ||
|
||
return ( | ||
<Button | ||
size="xs" | ||
colorScheme="primary" | ||
variant="outline" | ||
_text={{ | ||
padding: 0, | ||
textAlign: 'center', | ||
fontSize: 12, | ||
}} | ||
style={{ | ||
flex: 1, | ||
flexWrap: 'wrap', | ||
}} | ||
isLoading={loading} | ||
isLoadingText="Opening..." | ||
onPress={() => { | ||
setLoading(true); | ||
completeAction(props.id, props.type, user.id, props.formatId, props.sampleNumber, null, library.baseUrl, null, null).then((r) => { | ||
setLoading(false); | ||
}); | ||
}}> | ||
{props.title} | ||
</Button> | ||
); | ||
return ( | ||
<Button | ||
size="xs" | ||
variant="link" | ||
borderWidth={1} | ||
borderColor={theme['colors']['primary']['500']} | ||
onPress={() => { | ||
setLoading(true); | ||
completeAction(props.id, props.type, user.id, props.formatId, props.sampleNumber, null, library.baseUrl, null, null).then((r) => { | ||
setLoading(false); | ||
}); | ||
}}> | ||
{loading ? <ButtonSpinner color={theme['colors']['primary']['500']} /> : <ButtonText color={theme['colors']['primary']['500']}>{props.title}</ButtonText>} | ||
</Button> | ||
); | ||
}; |
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 |
---|---|---|
@@ -1,32 +1,31 @@ | ||
import { Button, ButtonText, ButtonSpinner } from '@gluestack-ui/themed'; | ||
import React from 'react'; | ||
import { Button } from 'native-base'; | ||
import { ThemeContext } from '../../context/initialContext'; | ||
|
||
// custom components and helper files | ||
import {openSideLoad} from '../../util/recordActions'; | ||
import { openSideLoad } from '../../util/recordActions'; | ||
|
||
export const OpenSideLoad = (props) => { | ||
const [loading, setLoading] = React.useState(false); | ||
const [loading, setLoading] = React.useState(false); | ||
const { theme } = React.useContext(ThemeContext); | ||
|
||
return ( | ||
<Button | ||
size="md" | ||
colorScheme="primary" | ||
variant="solid" | ||
_text={{ | ||
padding: 0, | ||
textAlign: 'center', | ||
}} | ||
style={{ | ||
flex: 1, | ||
flexWrap: 'wrap', | ||
}} | ||
isLoading={loading} | ||
isLoadingText="Opening..." | ||
onPress={async () => { | ||
setLoading(true); | ||
await openSideLoad(props.url).then((r) => setLoading(false)); | ||
}}> | ||
{props.title} | ||
</Button> | ||
); | ||
return ( | ||
<Button | ||
size="md" | ||
_text={{ | ||
padding: 0, | ||
textAlign: 'center', | ||
}} | ||
style={{ | ||
flex: 1, | ||
flexWrap: 'wrap', | ||
}} | ||
bgColor={theme['colors']['primary']['500']} | ||
onPress={async () => { | ||
setLoading(true); | ||
await openSideLoad(props.url).then((r) => setLoading(false)); | ||
}}> | ||
{loading ? <ButtonSpinner color={theme['colors']['primary']['500-text']} /> : <ButtonText color={theme['colors']['primary']['500-text']}>{props.title}</ButtonText>} | ||
</Button> | ||
); | ||
}; |
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
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
Oops, something went wrong.