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 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ const ServiceCard = ({ service, withBorder }) => {
selected={isSelected}
activeOpacity={!withBorder ? 1 : 0.5}
noBackground
disabled={unavailable}
onPress={() => {
if (withBorder) {
if (isSelected) {
Expand All @@ -131,9 +130,9 @@ const ServiceCard = ({ service, withBorder }) => {
source={{ uri: service.iconUrl }}
/>
</CarContainer>
<ServiceDetails unavailable={unavailable}>
<ServiceDetails>
<WrapRow>
<Title numberOfLines={2}>
<Title numberOfLines={2} unavailable={unavailable} primaryColor={theme.primaryColor}>
{service.name}
</Title>
<TitleContainer>
Expand All @@ -150,7 +149,7 @@ const ServiceCard = ({ service, withBorder }) => {
)
: <View />
}
<Price>
<Price unavailable={unavailable} primaryColor={theme.primaryColor}>
{getUnavailableText()}
</Price>
</TitleContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,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 ? 0.56 : 1)};
nihad-autofleet marked this conversation as resolved.
Show resolved Hide resolved
`;

export const CarIcon = styled.Image`
Expand All @@ -35,7 +35,7 @@ width: 80%;
display: flex;
flex-direction: column;
justify-content: center;
opacity: ${({ unavailable }) => (unavailable ? 0.4 : 1)};
opacity: ${({ unavailable }) => (unavailable ? 0.56 : 1)};
nihad-autofleet marked this conversation as resolved.
Show resolved Hide resolved
`;

export const Row = styled.View`
Expand All @@ -54,12 +54,15 @@ align-items: center;
export const Title = styled.Text`
${FONT_SIZES.H3};
${FONT_WEIGHTS.MEDIUM};
opacity: ${({ unavailable }) => (unavailable ? 0.56 : 1)};
color: ${({ unavailable, primaryColor }) => (unavailable ? '#7F7F7F' : primaryColor)};
margin-right: 5px;
`;

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

Expand Down
Loading