Skip to content

Commit

Permalink
GF-331: Fix route category spelling for bouldering
Browse files Browse the repository at this point in the history
  • Loading branch information
levenkov committed Dec 17, 2021
1 parent bd50eae commit 150e095
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "src/lib"]
path = src/lib
url = git@github.com:bitia-ru/gekkon-js-lib.git
branch = a8297271305cb3381ea925dacbded5b147e5790a
1 change: 1 addition & 0 deletions src/lib
Submodule lib added at a82972
3 changes: 2 additions & 1 deletion src/v1/components/RouteCard/RouteCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import RouteContext from '../../contexts/RouteContext';
import { avail, notAvail } from '../../utils';
import getArrayFromObject from '../../utils/getArrayFromObject';
import './RouteCard.css';
import { routeCategoryToString } from '@/lib/routeHelpers';

class RouteCard extends Component {
constructor(props) {
Expand Down Expand Up @@ -105,7 +106,7 @@ class RouteCard extends Component {
<span className="route-card__date" />
)
}
<div className="route-card__level">{route.category}</div>
<div className="route-card__level">{routeCategoryToString(route)}</div>
</div>
</div>
</article>
Expand Down
5 changes: 4 additions & 1 deletion src/v1/components/RouteDataTable/RouteDataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { GetUserName } from '../../Constants/User';
import { ROUTE_KINDS } from '../../Constants/Route';
import RouteColorPicker from '@/v2/components/RouteColorPicker/RouteColorPicker';
import './RouteDataTable.css';
import { routeCategoryToString } from '@/lib/routeHelpers';

const RouteDataTable = ({
user, route,
Expand All @@ -29,7 +30,9 @@ const RouteDataTable = ({
Категория:
</div>
<div className="route-data-table-item">
<div className="route-data-table__category-track">{route.category}</div>
<div className="route-data-table__category-track">
{routeCategoryToString(route)}
</div>
<div
className="route-data-table__category-track-color"
style={{ backgroundColor: getCategoryColor(route.category) }}
Expand Down
3 changes: 2 additions & 1 deletion src/v1/components/RouteRow/RouteRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import PropTypes from 'prop-types';
import { GetUserName } from '../../Constants/User';
import RouteColor from '../RouteColor/RouteColor';
import './RouteRow.css';
import { routeCategoryToString } from '@/lib/routeHelpers';

const RouteRow = ({ onRouteClick, route, user }) => {
const isCurrentUserRoute = user && route.author_id === user.id;
Expand All @@ -30,7 +31,7 @@ const RouteRow = ({ onRouteClick, route, user }) => {
{route.number ? `№${route.number}` : `#${route.id}`}
</div>
<div className="table-card__item table-card__name">{route.name}</div>
<div className="table-card__item table-card__category">{route.category}</div>
<div className="table-card__item table-card__category">{routeCategoryToString(route)}</div>
<div className="table-card__item table-card__marking">
<RouteColor size="medium" route={route} fieldName="holds_color" />
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/v1/components/Scheme/Scheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { HIDE_DELAY } from '../../Constants/Scheme';
import SchemePointer from '../SchemePointer/SchemePointer';
import SectorContext from '../../contexts/SectorContext';
import './Scheme.css';
import { routeCategoryToString } from '@/lib/routeHelpers';

class Scheme extends Component {
constructor(props) {
Expand Down Expand Up @@ -86,7 +87,7 @@ class Scheme extends Component {
? onStartMoving
: null
}
category={route.category}
category={routeCategoryToString(route)}
transparent={!R.contains(route.id, currentRoutes)}
color={
route.holds_color === null ? undefined : route.holds_color.color
Expand Down
3 changes: 2 additions & 1 deletion src/v2/components/RouteCard/RouteCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { timeFromNow } from '@/v1/Constants/DateTimeFormatter';
import RouteContext from '@/v1/contexts/RouteContext';
import { css } from '../../aphrodite';
import styles from './styles';
import { routeCategoryToString } from '@/lib/routeHelpers';


class RouteCard extends Component {
Expand Down Expand Up @@ -105,7 +106,7 @@ class RouteCard extends Component {
className={css(styles.routeCardCategory)}
style={{ borderColor: route.marks_color?.color || 'rgba(0, 0, 0, 0)' }}
>
{route.category}
{routeCategoryToString(route)}
</div>
{
route.holds_color && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import DatePicker from '@/v1/components/DatePicker/DatePicker';
import RouteContext from '@/v1/contexts/RouteContext';
import { css } from '@/v2/aphrodite';
import styles from './styles';
import { routeCategoryToString } from '@/lib/routeHelpers';

class RouteDataEditableTable extends Component {
constructor(props) {
Expand Down Expand Up @@ -76,7 +77,7 @@ class RouteDataEditableTable extends Component {
onClick={() => this.setState({ showSlider: !showSlider })}
>
<div className={css(styles.routeDataTableCategoryTrack)}>
{route.category}
{routeCategoryToString(route)}
</div>
<div
className={css(styles.routeDataTableCategoryTrackColor)}
Expand Down
5 changes: 4 additions & 1 deletion src/v2/components/RouteDataTable/RouteDataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { GetUserName } from '@/v1/Constants/User';
import { ROUTE_KINDS } from '@/v1/Constants/Route';
import RouteColorPicker from '../RouteColorPicker/RouteColorPicker';
import { StyleSheet, css } from '../../aphrodite';
import { routeCategoryToString } from '@/lib/routeHelpers';

const RouteDataTable = ({
user, route,
Expand All @@ -31,7 +32,9 @@ const RouteDataTable = ({
Категория:
</div>
<div className={css(styles.routeDataTableItem)}>
<div className={css(styles.routeDataTableCategoryTrack)}>{route.category}</div>
<div className={css(styles.routeDataTableCategoryTrack)}>
{routeCategoryToString(route)}
</div>
<div
className={css(styles.routeDataTableCategoryTrackColor)}
style={{ backgroundColor: getCategoryColor(route.category) }}
Expand Down
3 changes: 2 additions & 1 deletion src/v2/components/Scheme/Scheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { HIDE_DELAY } from '@/v1/Constants/Scheme';
import SchemePointer from '../SchemePointer/SchemePointer';
import SectorContext from '@/v1/contexts/SectorContext';
import { StyleSheet, css } from '../../aphrodite';
import { routeCategoryToString } from '@/lib/routeHelpers';

class Scheme extends Component {
constructor(props) {
Expand Down Expand Up @@ -86,7 +87,7 @@ class Scheme extends Component {
? onStartMoving
: null
}
category={route.category}
category={routeCategoryToString(route)}
transparent={!R.contains(route.id, currentRoutes)}
color={
route.holds_color === null ? undefined : route.holds_color.color
Expand Down
1 change: 1 addition & 0 deletions src/v2/components/SchemePointer/SchemePointer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { StyleSheet, css } from '../../aphrodite';
import { routeCategoryToString } from '@/lib/routeHelpers';

class SchemePointer extends Component {
onMouseDown = (event) => {
Expand Down

0 comments on commit 150e095

Please sign in to comment.