2020-12-12 00:49:03 -07:00
|
|
|
import { AnimatePresence } from 'framer-motion';
|
2020-11-30 00:21:00 -07:00
|
|
|
import { If, HyperglassForm, Results } from '~/components';
|
|
|
|
import { useGlobalState } from '~/context';
|
2020-12-17 16:37:36 -07:00
|
|
|
import { useLGState } from '~/hooks';
|
2020-11-30 00:21:00 -07:00
|
|
|
import { all } from '~/util';
|
|
|
|
import { Frame } from './frame';
|
|
|
|
|
|
|
|
export const Layout: React.FC = () => {
|
2020-12-17 16:37:36 -07:00
|
|
|
const { isSubmitting } = useGlobalState();
|
|
|
|
const { formData } = useLGState();
|
2020-11-30 00:21:00 -07:00
|
|
|
return (
|
|
|
|
<Frame>
|
|
|
|
<If
|
|
|
|
c={
|
|
|
|
isSubmitting.value &&
|
|
|
|
all(
|
|
|
|
formData.query_location.value,
|
|
|
|
formData.query_target.value,
|
|
|
|
formData.query_type.value,
|
|
|
|
formData.query_vrf.value,
|
|
|
|
)
|
|
|
|
}>
|
2020-12-17 16:37:36 -07:00
|
|
|
<Results />
|
2020-11-30 00:21:00 -07:00
|
|
|
</If>
|
|
|
|
<AnimatePresence>
|
|
|
|
<If c={!isSubmitting.value}>
|
2020-12-12 00:49:03 -07:00
|
|
|
<HyperglassForm />
|
2020-11-30 00:21:00 -07:00
|
|
|
</If>
|
|
|
|
</AnimatePresence>
|
|
|
|
</Frame>
|
|
|
|
);
|
|
|
|
};
|