Skip to content

Instantly share code, notes, and snippets.

@hpstuff
Created March 30, 2018 11:17
Show Gist options
  • Save hpstuff/71d6cb7b30edb2fb26700ce5c79ceaa1 to your computer and use it in GitHub Desktop.
Save hpstuff/71d6cb7b30edb2fb26700ce5c79ceaa1 to your computer and use it in GitHub Desktop.
flow
//@flow
import type { ComponentType } from 'react';
import React from 'react';
import styled from 'styled-components';
type Align = 'flex-start' | 'flex-end' | 'center';
type Props = {
align?: Align;
}
export const Container: ComponentType<Props> = styled.View`
flex: 1;
align-items: ${({align = 'center'}) => align};
justify-content: center;
background-color: #fff;
`;
//@flow
import React, { Component } from 'react';
import { Text } from 'react-native';
import { Container } from '../components';
export default class Landing extends Component<{}> {
render() {
return (
<Container>
<Text testID={`landing-text`}>{`Landing`}</Text>
</Container>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment