Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
REACT_APP_BASE_API_URL=http://52.204.195.181:8000/api/v1/jobs
REACT_APP_BASE_API_URL=https://jobhopper.aballslab.com/api/v1/jobs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import React from 'react';
// also exported from '@storybook/react' if you can deal with breaking changes in 6.1
import { Story, Meta } from '@storybook/react/types-6-0';

import LandingBlurb from './LandingBlurb';
import { LandingBlurbContainer } from './LandingBlurbContainer';

export default {
title: 'JobHopper/LandingBlurb',
component: LandingBlurb,
component: LandingBlurbContainer,
} as Meta;

const Template: Story = () => <LandingBlurb />;
const Template: Story = () => <LandingBlurbContainer />;

export const Default = Template.bind({});
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,30 @@ import { Collapse } from '@material-ui/core';
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
import React, { useState } from 'react';
import styled from 'styled-components';
import { Section } from './Common';
import { Body, Title } from './Typography';
import { Section } from '../Common';
import { Body, Title } from '../Typography';
import { useEffect } from 'react';
import { useOccupationsState } from '../../ducks/occupations';

const CollapsingSection = styled(Section)`

export const LandingBlurbContainer = () => {
const [show, setShow] = useState(true);
const [hasClicked, setHasClicked] = useState(false);
const {selectedOccupation} = useOccupationsState();

useEffect(() => {
if (selectedOccupation && show && !hasClicked) {
setShow(false);
}
})

return <LandingBlurbCN show={show} onClick={() => {
setShow(show => !show);
setHasClicked(true);
}}/>;
}

const CollapsingSection = styled(Section)`
& p {
margin-block: 0;
margin-bottom: 48px;
Expand All @@ -16,7 +36,7 @@ const CollapseIcon = styled(ExpandMoreIcon)`
vertical-align: middle;
`;

export default function LandingBlurb() {
export default function LandingBlurbCN() {
const [show, setShow] = useState(true);
return (
<CollapsingSection>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/ui/LandingBlurb/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { LandingBlurbContainer } from './LandingBlurbContainer';
6 changes: 4 additions & 2 deletions frontend/src/ui/TransitionPage/TransitionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import React from 'react';
import { LabeledSection } from '../Common';
import Page from '../Page';
import { ResultsContainer } from '../Results';
import LandingBlurb from '../LandingBlurb';
import { LandingBlurbContainer } from '../LandingBlurb';
import { OccupationSelectContainer, StateSelectContainer } from '../Select';
import { createContainerContext } from '../utils';


const { ContainerContext, useContainerContext } = createContainerContext({
OccupationSelectContainer,
StateSelectContainer,

ResultsContainer,
});

Expand All @@ -20,7 +22,7 @@ const TransitionPage: React.FC = () => {
} = useContainerContext();
return (
<Page>
<LandingBlurb />
<LandingBlurbContainer />
<LabeledSection
title="Enter occupation"
subtitle="Type in an occupation by name or SOC code."
Expand Down