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

JSAB2-75 Leaderboard #16

Merged
merged 18 commits into from
Dec 11, 2019
Merged
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
Next Next commit
JSAB2-75, add SubCardView
  • Loading branch information
GuJialu committed Dec 10, 2019
commit 7195d0bc3f1047f4b45ea9399eff8b95e2380894
1 change: 1 addition & 0 deletions frontend/src/common/colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export default {
lightenGrey: '#f5f5f5',
tealColor: '#10978b',
redColor: '#f44336',
whiteColor: '#ffffff',
};
36 changes: 36 additions & 0 deletions frontend/src/common/components/SubCardView.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React from 'react';
import PropTypes from 'prop-types';
import { View, ViewPropTypes } from 'react-native';
import Colors from '../colors';

const defaultStyle = {
marginBottom: 2,
padding: 12,
borderRadius: 5,
alignSelf: 'stretch',
backgroundColor: Colors.tealColor,
flexDirection: 'row',
shadowColor: '#fff',
};

function SubCardView({ style, children }) {
return (
<View style={[defaultStyle, style]}>
{children}
</View>
);
}

SubCardView.propTypes = {
style: ViewPropTypes.style,
children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node),
PropTypes.node,
]).isRequired,
};

SubCardView.defaultProps = {
style: null,
};

export default SubCardView;
1 change: 1 addition & 0 deletions frontend/src/common/components/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable import/prefer-default-export */
export { default as CardView } from './CardView';
export { default as TouchableImage } from './TouchableImage';
export { default as SubCardView } from './SubCardView';