Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
issue#10 explore section and upload button list (#12)
Browse files Browse the repository at this point in the history
* issue#10 explore section and upload button list

* issue#10 minor ui changes and passing values as props

* minor changes done

* issue#13 ui fixes and improvements

* Removed margin bottom

Co-authored-by: Omkar Prabhu <[email protected]>
  • Loading branch information
akshaypithadiya and prabhuomkar authored Sep 22, 2021
1 parent 3fced6b commit a1d96a1
Show file tree
Hide file tree
Showing 16 changed files with 300 additions and 11 deletions.
21 changes: 21 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"@rmwc/drawer": "^6.1.4",
"@rmwc/grid": "^6.1.4",
"@rmwc/icon": "^6.1.4",
"@rmwc/image-list": "^6.1.4",
"@rmwc/list": "^6.1.4",
"@rmwc/textfield": "^6.1.4",
"@rmwc/theme": "^6.1.4",
Expand Down
Binary file added frontend/public/avatar.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/places.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/things.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const App = () => {
options={{
primary: '#812ce5',
secondary: '#ffffff',
onPrimary: '#ffffff',
onPrimary: '#812ce5',
textPrimaryOnBackground: '#000',
}}
>
Expand Down
16 changes: 11 additions & 5 deletions frontend/src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ $font: 'Inter', sans-serif !important;
$primary-color: #ffffff;
$secondary-color: #812ce5;
$font-color: #000000;
$link-color: #4c959a;
$link-color: #4800b2;
$primary-light-color: #eadafb;
$primary-dark-color: #4800b2;

Expand Down Expand Up @@ -45,13 +45,14 @@ p {
}

.top-app-bar {
background-color: $secondary-color;
background-color: $primary-color;
border-bottom: 1px solid #e0e0e0;
}

.header-title {
display: flex;
text-decoration: none;
color: #ffffff !important;
color: #812ce5 !important;
align-content: space-between;
}

Expand All @@ -65,6 +66,7 @@ p {
/* sidenav styles start */
.drawer {
position: fixed;
margin: 1px 0px !important;
}

.drawer-content {
Expand Down Expand Up @@ -130,11 +132,15 @@ p {

.search-bar {
border-radius: 4px !important;
background-color: white !important;
background-color: #f1f3f4 !important;
height: 40px;
width: 100%;
}

.search-bar:focus {
outline: none !important;
}

@media only screen and (max-width: 600px) {
.search-bar-section {
max-width: 180px;
Expand All @@ -144,4 +150,4 @@ p {
.grid-cols > .mdc-layout-grid__inner {
display: flex;
justify-content: space-between;
}
}
2 changes: 1 addition & 1 deletion frontend/src/components/SideNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const SideNav = (props) => {
className="nav-link"
activeClassName="activated"
exact
to={item.link_to}
to={`/${item.link_to}`}
>
<ListItem className="list-item">
<Icon className="side-nav-icon" icon={item.icon} />
Expand Down
38 changes: 38 additions & 0 deletions frontend/src/components/explore/ExploreEntity.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React from 'react';
import PropTypes from 'prop-types';
import {
ImageList,
ImageListImage,
ImageListItem,
ImageListSupporting,
ImageListLabel,
} from '@rmwc/image-list';
import '@rmwc/image-list/styles';

const ExploreEntity = ({ data }) => {
return (
<>
<ImageList
withTextProtection
style={{
columnGap: '12px',
}}
>
{data.map((src) => (
<ImageListItem key={src.image} style={{ marginBottom: '12px' }}>
<ImageListImage src={src.image} style={{ width: '180px' }} />
<ImageListSupporting>
<ImageListLabel>{src.label}</ImageListLabel>
</ImageListSupporting>
</ImageListItem>
))}
</ImageList>
</>
);
};

ExploreEntity.propTypes = {
data: PropTypes.array,
};

export default ExploreEntity;
58 changes: 58 additions & 0 deletions frontend/src/components/explore/ExploreEntityList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import React from 'react';
import PropTypes from 'prop-types';
import {
ImageList,
ImageListImage,
ImageListItem,
ImageListImageAspectContainer,
} from '@rmwc/image-list';
import '@rmwc/image-list/styles';

const ExploreEntityList = ({ data, type }) => {
const stylePeopleList = {
radius: '50%',
width: '10%',
margin: '0px 6px 6px 6px',
};

const stylePlacesThigsList = {
radius: '6px',
width: '13%',
margin: '0px 6px 12px 6px',
};

return (
<>
<ImageList>
{data.map((src) => (
<ImageListItem
key={src}
style={
type === 'PeopleList' ? stylePeopleList : stylePlacesThigsList
}
>
<ImageListImageAspectContainer>
<ImageListImage
src={src}
style={{
borderRadius:
type === 'PeopleList'
? stylePeopleList.radius
: stylePlacesThigsList.radius,
cursor: 'pointer',
}}
/>
</ImageListImageAspectContainer>
</ImageListItem>
))}
</ImageList>
</>
);
};

ExploreEntityList.propTypes = {
type: PropTypes.string,
data: PropTypes.array,
};

export default ExploreEntityList;
1 change: 1 addition & 0 deletions frontend/src/components/header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const Header = ({ toggleSideNav }) => {
<SearchBar />
</TopAppBarSection>
<TopAppBarSection alignEnd>
<TopAppBarActionItem icon="file_upload" />
<TopAppBarActionItem icon="help" />
<TopAppBarActionItem icon="settings" />
</TopAppBarSection>
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Content from './Content';
import SideNav from './SideNav';
import Header from './header/Header';
import ExploreEntityList from './explore/ExploreEntityList';
import ExploreEntity from './explore/ExploreEntity';

export { Content, SideNav, Header };
export { Content, SideNav, Header, ExploreEntityList, ExploreEntity };
48 changes: 48 additions & 0 deletions frontend/src/pages/explore/Explore.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,41 @@
import React from 'react';
import { Link } from 'react-router-dom';
import { Grid, GridCell } from '@rmwc/grid';
import { ExploreEntityList } from '../../components';
import '@rmwc/grid/styles';

const peopleList = [
'/avatar.jpg',
'/avatar.jpg',
'/avatar.jpg',
'/avatar.jpg',
'/avatar.jpg',
'/avatar.jpg',
'/avatar.jpg',
'/avatar.jpg',
'/avatar.jpg',
];

const placesList = [
'/places.jpg',
'/places.jpg',
'/places.jpg',
'/places.jpg',
'/places.jpg',
'/places.jpg',
'/places.jpg',
];

const thingsList = [
'/things.jpeg',
'/things.jpeg',
'/things.jpeg',
'/things.jpeg',
'/things.jpeg',
'/things.jpeg',
'/things.jpeg',
];

const Explore = () => {
return (
<>
Expand All @@ -16,6 +49,11 @@ const Explore = () => {
</Link>
</GridCell>
</Grid>
<Grid>
<GridCell desktop={12} tablet={12} phone={12}>
<ExploreEntityList type="PeopleList" data={peopleList} />
</GridCell>
</Grid>
<Grid className="grid-cols">
<GridCell desktop={10} tablet={6} phone={3}>
Places
Expand All @@ -26,6 +64,11 @@ const Explore = () => {
</Link>
</GridCell>
</Grid>
<Grid>
<GridCell desktop={12} tablet={12} phone={12}>
<ExploreEntityList type="PlacesList" data={placesList} />
</GridCell>
</Grid>
<Grid className="grid-cols">
<GridCell desktop={10} tablet={6} phone={3}>
Things
Expand All @@ -36,6 +79,11 @@ const Explore = () => {
</Link>
</GridCell>
</Grid>
<Grid>
<GridCell desktop={12} tablet={12} phone={12}>
<ExploreEntityList type="ThingsList" data={thingsList} />
</GridCell>
</Grid>
</>
);
};
Expand Down
40 changes: 39 additions & 1 deletion frontend/src/pages/explore/People.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,45 @@
import React from 'react';
import { Grid, GridCell } from '@rmwc/grid';
import { ExploreEntity } from '../../components';

const People = () => {
return <>People</>;
const peopleData = [
{ image: '/avatar.jpg', label: 'People' },
{ image: '/avatar.jpg', label: 'People' },
{ image: '/avatar.jpg', label: 'People' },
{ image: '/avatar.jpg', label: 'People' },
{ image: '/avatar.jpg', label: 'People' },
{ image: '/avatar.jpg', label: 'People' },
{ image: '/avatar.jpg', label: 'People' },
{ image: '/avatar.jpg', label: 'People' },
{ image: '/avatar.jpg', label: 'People' },
{ image: '/avatar.jpg', label: 'People' },
{ image: '/avatar.jpg', label: 'People' },
{ image: '/avatar.jpg', label: 'People' },
{ image: '/avatar.jpg', label: 'People' },
{ image: '/avatar.jpg', label: 'People' },
{ image: '/avatar.jpg', label: 'People' },
{ image: '/avatar.jpg', label: 'People' },
{ image: '/avatar.jpg', label: 'People' },
{ image: '/avatar.jpg', label: 'People' },
{ image: '/avatar.jpg', label: 'People' },
{ image: '/avatar.jpg', label: 'People' },
];

return (
<>
<Grid className="grid-cols">
<GridCell desktop={10} tablet={6} phone={3}>
People
</GridCell>
</Grid>
<Grid>
<GridCell desktop={12} tablet={12} phone={12}>
<ExploreEntity data={peopleData} />
</GridCell>
</Grid>
</>
);
};

export default People;
Loading

0 comments on commit a1d96a1

Please sign in to comment.