commit changes to grid tiles

This commit is contained in:
João Mendes 2020-04-11 12:56:03 +01:00
parent ad29ab13ea
commit b65231ad2c
9 changed files with 29 additions and 28 deletions

View File

@ -24,7 +24,11 @@ This Web Part uses MSgraph Open Extension to save the personal information on us
     
![Birthdays Web Part](./assets/Image1.png) ![Birthdays Web Part](./assets/image14.png)
![Birthdays Web Part](./assets/image13.png)
![Birthdays Web Part](./assets/image12.png)
![PersonalApps](./assets/image11.png) ![PersonalApps](./assets/image11.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 929 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

View File

@ -2,22 +2,7 @@
@import "~office-ui-fabric-react/dist/sass/semanticSlots"; @import "~office-ui-fabric-react/dist/sass/semanticSlots";
@import './node_modules/spfx-uifabric-themes/office.theme'; @import './node_modules/spfx-uifabric-themes/office.theme';
@import "./../../../../Common/themeColors.module.scss"; @import "./../../../../Common/themeColors.module.scss";
@media screen and (min-width: 40em) {
.card {
max-width: calc(50% - 1em);
}
}
@media screen and (min-width: 60em) {
.card {
max-width: calc(25% - 1em);
}
}
@media all and (min-width: 480px) and (max-width: 768px) {
.card {
max-width: 100%;
}
}
.card { .card {
@ -25,7 +10,7 @@
min-height: 60px; min-height: 60px;
max-height: 60px; max-height: 60px;
min-width: 300px;
justify-content: start; justify-content: start;
margin-bottom: 5px; margin-bottom: 5px;
margin-right: 5px; margin-right: 5px;
@ -33,11 +18,14 @@
border-style: solid; border-style: solid;
border-width: 1px; border-width: 1px;
border-color: $ms-color-neutralTertiaryAlt; border-color: $ms-color-neutralTertiaryAlt;
padding: 20px; padding-left: 20px;
padding-right: 20px;
padding-top: 12px;
padding-bottom: 12px;
align-items: flex-start; align-items: flex-start;
background-color:$bodyBackgroundColor; background-color:$bodyBackgroundColor;
color: $bodyTextColor; color: $bodyTextColor;
flex: 0 1 365px; max-width:100%;
} }
.card:hover { .card:hover {

View File

@ -4,17 +4,16 @@
.tile { .tile {
display: flex; display: flex;
max-width: 120px;
min-height: 120px; min-height: 120px;
max-height: 120px; max-height: 120px;
min-width: 120px; /* min-width: 120px;*/
justify-content: start; justify-content: start;
margin: 5px; margin: 5px;
flex-direction: column; flex-direction: column;
border-style: solid; border-style: solid;
border-width: 1px; border-width: 1px;
border-color: $ms-color-neutralTertiaryAlt; border-color: $ms-color-neutralTertiaryAlt;
padding: 10px; /* padding: 10px; */
align-items: center; align-items: center;
justify-items: center; justify-items: center;
justify-content: center; justify-content: center;

View File

@ -3,12 +3,14 @@ import { IAppTileProps } from "./IAppTileProps";
import * as React from "react"; import * as React from "react";
import * as ReactDom from "react-dom"; import * as ReactDom from "react-dom";
import styles from "./AppTile.module.scss"; import styles from "./AppTile.module.scss";
import { PropertyFieldCollectionDataHost } from "@pnp/spfx-property-controls/lib/PropertyFieldCollectionData";
export const AppTile = (props: IAppTileProps) => { export const AppTile = (props: IAppTileProps) => {
return ( return (
<> <>
<div <div
className={styles.tile} className={styles.tile}
title={props.description}
onClick={event => { onClick={event => {
event.preventDefault(); event.preventDefault();
window.open(props.url, "_blank"); window.open(props.url, "_blank");

View File

@ -20,11 +20,19 @@
.personalApps { .personalApps {
padding-top: 15px; padding-top: 15px;
.container { .containerTiles {
margin-top:15px; margin-top:15px;
display: flex;
flex-direction: row; display: grid;
flex-wrap: wrap; grid-template-columns: repeat( auto-fit, minmax(120px, 1fr) );
grid-template-rows: auto;
}
.containerItems {
margin-top:15px;
width: 100%;
display: grid;
grid-template-columns: repeat( auto-fit, minmax(220px, 1fr) );
grid-template-rows: auto;
} }
.row { .row {

View File

@ -102,7 +102,7 @@ export default class PersonalApps extends React.Component<
}} }}
/> />
)} )}
<div className={styles.container}>
{isLoading && ( {isLoading && (
<div <div
style={{ style={{
@ -119,7 +119,7 @@ export default class PersonalApps extends React.Component<
{errorMessage} {errorMessage}
</MessageBar> </MessageBar>
)} )}
<div className={view == 'Tiles' ? styles.containerTiles : styles.containerItems }>
{apps && {apps &&
apps.length > 0 && apps.length > 0 &&
apps.map(item => { apps.map(item => {