Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
annagav committed Jan 10, 2025
1 parent 91003f5 commit b8f8cb2
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 30 deletions.
26 changes: 18 additions & 8 deletions frontend/public/src/components/CourseProductDetailEnroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import { Modal, ModalBody, ModalHeader } from "reactstrap"

import Loader from "./Loader"
import { routes } from "../lib/urls"
import {getFlexiblePriceForProduct, formatLocalePrice, checkFeatureFlag} from "../lib/util"
import {
getFlexiblePriceForProduct,
formatLocalePrice,
checkFeatureFlag
} from "../lib/util"
import { EnrollmentFlaggedCourseRun } from "../flow/courseTypes"
import {
coursesSelector,
Expand Down Expand Up @@ -244,8 +248,12 @@ export class CourseProductDetailEnroll extends React.Component<
course.page &&
course.page.financial_assistance_form_url &&
!run.approved_flexible_price_exists ? (
<a href={course && course.page && course.page.financial_assistance_form_url}
className="finaid-link">
<a
href={
course && course.page && course.page.financial_assistance_form_url
}
className="finaid-link"
>
Need financial assistance?
</a>
) : null
Expand Down Expand Up @@ -313,10 +321,10 @@ export class CourseProductDetailEnroll extends React.Component<
<img src="/static/images/certificates/certificate-logo.svg" />
</div>
<p>
<strong> Certificate track:{" "} </strong>
<strong> Certificate track: </strong>
{product &&
run.is_upgradable &&
formatLocalePrice(getFlexiblePriceForProduct(product))}
run.is_upgradable &&
formatLocalePrice(getFlexiblePriceForProduct(product))}
<>
<br />
{canUpgrade ? (
Expand All @@ -339,7 +347,9 @@ export class CourseProductDetailEnroll extends React.Component<
<form
action="/cart/add/"
method="get"
className={`text-center ${newCartDesign ? "new-design" : ""}`}
className={`text-center ${
newCartDesign ? "new-design" : ""
}`}
>
<input
type="hidden"
Expand All @@ -351,7 +361,7 @@ export class CourseProductDetailEnroll extends React.Component<
className="btn btn-upgrade btn-gradient-red-to-blue"
disabled={!canUpgrade}
>
<i className="shopping-cart-line-icon"/>
<i className="shopping-cart-line-icon" />
<div className="upgrade-btn-text">
<strong>Add to Cart</strong>
<br />
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import TopBar from "./TopBar"

type Props = {
currentUser: CurrentUser,
location: ?Location,
location: ?Location
}

const Header = ({ currentUser, location }: Props) => {
Expand Down
42 changes: 22 additions & 20 deletions frontend/public/src/components/TopBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { checkFeatureFlag } from "../lib/util"

type Props = {
currentUser: CurrentUser,
location: ?Location,
location: ?Location
}

const TopBar = ({ currentUser }: Props) => {
Expand Down Expand Up @@ -68,36 +68,38 @@ const TopBar = ({ currentUser }: Props) => {
<div className="full-screen-top-menu">
{currentUser.is_authenticated ? (
<>
{newCartDesign ?
(<>
{newCartDesign ? (
<>
<button
className="shopping-cart-line"
onClick={() => (
window.location = routes.cart
)}
onClick={() => (window.location = routes.cart)}
aria-label="Cart"
/>
{cartItemCount ? <span className='badge' id="cart-count">{cartItemCount}</span> : null}
{cartItemCount ? (
<span className="badge" id="cart-count">
{cartItemCount}
</span>
) : null}
<MixedLink
id="catalog"
dest={routes.catalog}
className="top-nav-link border-left-top-bar"
aria-label="Catalog"
>
Catalog
</MixedLink></>
) : (
<MixedLink
id="catalog"
dest={routes.catalog}
className="top-nav-link"
aria-label="Catalog"
>
Catalog
Catalog
</MixedLink>
)
}
<UserMenu currentUser={currentUser} useScreenOverlay={false}/>
</>
) : (
<MixedLink
id="catalog"
dest={routes.catalog}
className="top-nav-link"
aria-label="Catalog"
>
Catalog
</MixedLink>
)}
<UserMenu currentUser={currentUser} useScreenOverlay={false} />
</>
) : (
<AnonymousMenu mobileView={false} />
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/src/containers/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class App extends React.Component<Props, void> {
}

const mapStateToProps = createStructuredSelector({
currentUser: currentUserSelector,
currentUser: currentUserSelector
})

const mapDispatchToProps = {
Expand Down

0 comments on commit b8f8cb2

Please sign in to comment.