diff options
author | Ty Dunn <ty@tydunn.com> | 2023-07-06 12:22:20 -0700 |
---|---|---|
committer | Ty Dunn <ty@tydunn.com> | 2023-07-06 12:22:20 -0700 |
commit | 9017dce91c5adf6d089bd7bc88480a4e1befba65 (patch) | |
tree | 63dd7ce9431807118f8999ddeb7bc80904312e6b /extension/react-app/src/components/Loader.tsx | |
parent | 9f32c906023c596a7610ee4d1d6cff9f1201a5dc (diff) | |
parent | 1e00942edec9c9aa4c69f2a8be7e43f06df684df (diff) | |
download | sncontinue-9017dce91c5adf6d089bd7bc88480a4e1befba65.tar.gz sncontinue-9017dce91c5adf6d089bd7bc88480a4e1befba65.tar.bz2 sncontinue-9017dce91c5adf6d089bd7bc88480a4e1befba65.zip |
Merge branch 'main' of github.com:continuedev/continue
Diffstat (limited to 'extension/react-app/src/components/Loader.tsx')
-rw-r--r-- | extension/react-app/src/components/Loader.tsx | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/extension/react-app/src/components/Loader.tsx b/extension/react-app/src/components/Loader.tsx new file mode 100644 index 00000000..90eff793 --- /dev/null +++ b/extension/react-app/src/components/Loader.tsx @@ -0,0 +1,40 @@ +import { Play } from "@styled-icons/heroicons-outline"; +import { useSelector } from "react-redux"; +import styled from "styled-components"; +import { RootStore } from "../redux/store"; + +const DEFAULT_SIZE = "28px"; + +const FlashingDiv = styled.div` + margin: auto; + width: ${DEFAULT_SIZE}; + animation: flash 1.2s infinite ease-in-out; + @keyframes flash { + 0% { + opacity: 0.4; + } + 50% { + opacity: 1; + } + 100% { + opacity: 0.4; + } + } +`; + +function Loader(props: { size?: string }) { + const vscMediaUrl = useSelector( + (state: RootStore) => state.config.vscMediaUrl + ); + return ( + <FlashingDiv> + {vscMediaUrl ? ( + <img src={`${vscMediaUrl}/play_button.png`} width="22px" /> + ) : ( + <Play width={props.size || DEFAULT_SIZE} /> + )} + </FlashingDiv> + ); +} + +export default Loader; |