Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/bureau position results card #1012

Merged
merged 4 commits into from
Jul 20, 2020

Conversation

mjoyce91
Copy link

Depends on #1006

Adds static position results card to be integrated in the future. Placed it on the Bureau Stats page for now.

Comment on lines 73 to 101
<Row fluid className="bureau-results-card">
<Row fluid>
<Row fluid style={{ display: 'flex' }} className="bureau-card--header">
<div>{detailsLink}</div>
<div>{postShort}</div>
{renderBidCountMobile(stats)}
</Row>
<Row fluid style={{ display: 'flex' }} className="bureau-card--content">
<DefinitionList itemProps={{ excludeColon: true }} items={sections[0]} style={{ display: 'flex' }} className="bureau-definition" />
</Row>
<Row fluid style={{ display: 'flex' }} className="bureau-card--footer">
<DefinitionList items={sections[1]} style={{ display: 'flex' }} />
<div className="usa-grid-full" style={{ position: 'relative' }}>
<InteractiveElement onClick={() => this.setState({ showMore: !showMore })} style={{ bottom: 0, position: 'absolute', right: 0 }}>
<span style={{ whiteSpace: 'nowrap' }}>View {showMore ? 'less' : 'more'} </span>
<FA name={`chevron-${showMore ? 'up' : 'down'}`} />
</InteractiveElement>
</div>
</Row>
</Row>
{
showMore &&
<Row fluid style={{ marginTop: '1em' }}>
<Linkify properties={{ target: '_blank' }}>
{description}
</Linkify>
</Row>
}
</Row>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to clean up the inline styles here before merging

Copy link

@elizabeth-jimenez elizabeth-jimenez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍬 🍰 🥮 🎊 👍 very nice! 😸

describe('BureauPage', () => {
it('mounts', () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😿

@@ -1,23 +1,8 @@
import React from 'react';
import { shallow } from 'enzyme';
import TestUtils from 'react-dom/test-utils';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😭

import { Row } from 'Components/Layout';
import DefinitionList from 'Components/DefinitionList';
import InteractiveElement from 'Components/InteractiveElement';
import { getResult, getBidStatsToUse, getDifferentials, renderBidCountMobile } from 'Components/ResultsCard/ResultsCard';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😎

Don't think i've ever seen this used like this before. Very cool 🏅

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we already had that logic built out in the ResultsCard component, so instead of re-creating or moving it to utilities, I just exported those functions.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll keep that in mind, as we build out other Bureau stuff 🆒

@@ -22,6 +23,11 @@ const Stats = (props) => {
<div className="usa-grid-full bureau-page">
{placeholderText}
</div>
<div className="usa-grid-full">
{[1, 2, 3, 4, 5].map((m) => (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗺️ ❤️

import PropTypes from 'prop-types';
import { get } from 'lodash';
import FA from 'react-fontawesome';
import Linkify from 'react-linkify';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⛓️

import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import PropTypes from 'prop-types';
import { get } from 'lodash';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only 1 for lodash? I'm disappointed....

@mjoyce91 mjoyce91 merged commit 0262111 into dev Jul 20, 2020
@mjoyce91 mjoyce91 deleted the feature/bureau-position-results-card branch July 20, 2020 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants