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

Styling service is unavailable component #799

Closed
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 examples/client/Locomotion/src/I18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"multi": "Stop"
},
"highEta": "ETA is higher than usual",
"outOfTerritory": "Not in territory"
"outOfTerritory": "Service is \n unavailable"
},
"general": {
"back": "Back",
Expand Down
4 changes: 2 additions & 2 deletions examples/client/Locomotion/src/assets/seat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,14 @@ const ServiceCard = ({ service, withBorder }) => {
selected={isSelected}
activeOpacity={!withBorder ? 1 : 0.5}
noBackground
disabled={unavailable}
onPress={() => {
if (withBorder) {
if (isSelected) {
return setPopup(FARE_POPUP);
if (!unavailable) {
if (withBorder) {
if (isSelected) {
return setPopup(FARE_POPUP);
}
setChosenService(service);
}
setChosenService(service);
}
}}
>
Expand Down Expand Up @@ -150,7 +151,7 @@ const ServiceCard = ({ service, withBorder }) => {
)
: <View />
}
<Price>
<Price unavailable={unavailable}>
{getUnavailableText()}
</Price>
</TitleContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import styled from 'styled-components';
import Button from '../../../../../../Components/Button';
import { FONT_SIZES, FONT_WEIGHTS } from '../../../../../../context/theme';

const UNAVAILABLE_OPACITY = 0.56;

export const TitleContainer = styled.View`
display: flex;
flex-direction: row;
Expand All @@ -23,7 +25,7 @@ ${({ selected, withBorder }) => (withBorder && selected && 'box-shadow: 0 0 4px

export const CarContainer = styled.View`
width: 20%;
opacity: ${({ unavailable }) => (unavailable ? 0.4 : 1)};
opacity: ${({ unavailable }) => (unavailable ? UNAVAILABLE_OPACITY : 1)};
`;

export const CarIcon = styled.Image`
Expand All @@ -35,7 +37,7 @@ width: 80%;
display: flex;
flex-direction: column;
justify-content: center;
opacity: ${({ unavailable }) => (unavailable ? 0.4 : 1)};
opacity: ${({ unavailable }) => (unavailable ? UNAVAILABLE_OPACITY : 1)};
`;

export const Row = styled.View`
Expand All @@ -54,13 +56,16 @@ align-items: center;
export const Title = styled.Text`
${FONT_SIZES.H3};
${FONT_WEIGHTS.MEDIUM};
opacity: ${({ unavailable }) => (unavailable ? UNAVAILABLE_OPACITY : 1)};
color: #101010;
margin-right: 5px;
`;

export const Price = styled.Text`
${FONT_SIZES.LARGE};
${FONT_WEIGHTS.MEDIUM};
text-align: right;
${FONT_SIZES.LARGE};
${FONT_WEIGHTS.MEDIUM};
color: ${({ unavailable }) => (unavailable ? '#7F7F7F' : '#101010')};
text-align: right;
`;

export const TimeDetails = styled.View`
Expand All @@ -77,8 +82,8 @@ ${FONT_SIZES.LARGE}
`;

export const Eta = styled.Text`
opacity: .5;
${FONT_SIZES.LARGE}
color: #101010;
`;

export const Capacity = styled.View`
Expand All @@ -88,26 +93,26 @@ align-items: center;
`;

export const Circle = styled.View`
background-color: #333333;
opacity: .5;
background-color: #101010;
border-radius: 2px;
width: 2px;
height: 2px;
margin: 5px;
`;

export const AvailableSeats = styled.Text`
color: #101010;

`;
export const Description = styled.Text`
opacity: .5;
${FONT_SIZES.MEDIUM};
${FONT_WEIGHTS.REGULAR};
width: 85%;
color: #101010;
`;

export const EstimatedText = styled.Text`
color: #707070;
color: #101010;
${FONT_SIZES.MEDIUM};
${FONT_WEIGHTS.REGULAR};
`;
Expand Down
Loading