From 2b2a6a5c4b4a4a104f9de004d13b86edd6dcb7e5 Mon Sep 17 00:00:00 2001 From: fredupstair Date: Tue, 29 Oct 2019 00:39:03 +0100 Subject: [PATCH] mocked tab list --- .../ReactTeamsTabsPnpjs.module.scss | 71 +++++++------- .../components/ReactTeamsTabsPnpjs.tsx | 93 ++++++++++++++++--- 2 files changed, 118 insertions(+), 46 deletions(-) diff --git a/src/webparts/reactTeamsTabsPnpjs/components/ReactTeamsTabsPnpjs.module.scss b/src/webparts/reactTeamsTabsPnpjs/components/ReactTeamsTabsPnpjs.module.scss index 7ede3f9b3..74f5af703 100644 --- a/src/webparts/reactTeamsTabsPnpjs/components/ReactTeamsTabsPnpjs.module.scss +++ b/src/webparts/reactTeamsTabsPnpjs/components/ReactTeamsTabsPnpjs.module.scss @@ -7,6 +7,42 @@ box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 25px 50px 0 rgba(0, 0, 0, 0.1); } + .itemContent{ + margin-left: 10; + overflow: hidden; + } + + .itemName{ + font-size: initial; + white-space: nowrap; + overflow: 'hidden'; + text-overflow: 'ellipsis'; + } + + .itemCell{ + margin: 2px; + min-height: 54; + padding: 10; + box-sizing: 'border-box'; + //border: 1px solid; + display: 'flex'; + background : $ms-color-themeDarkAlt; + } + + .itemCell:hover{ + background : $ms-color-themeDarker; + } + .itemIndex { + font-size : initial; + //color : $ms-color-neutralTertiary; + margin-bottom : 10; + } + + .tablink{ + color : $ms-color-neutralTertiary; + margin-bottom : 10; + } + .row { @include ms-Grid-row; @include ms-fontColor-white; @@ -37,38 +73,5 @@ @include ms-fontColor-white; } - .button { - // Our button - text-decoration: none; - height: 32px; - // Primary Button - min-width: 80px; - background-color: $ms-color-themePrimary; - border-color: $ms-color-themePrimary; - color: $ms-color-white; - - // Basic Button - outline: transparent; - position: relative; - font-family: "Segoe UI WestEuropean","Segoe UI",-apple-system,BlinkMacSystemFont,Roboto,"Helvetica Neue",sans-serif; - -webkit-font-smoothing: antialiased; - font-size: $ms-font-size-m; - font-weight: $ms-font-weight-regular; - border-width: 0; - text-align: center; - cursor: pointer; - display: inline-block; - padding: 0 16px; - - .label { - font-weight: $ms-font-weight-semibold; - font-size: $ms-font-size-m; - height: 32px; - line-height: 32px; - margin: 0 4px; - vertical-align: top; - display: inline-block; - } - } -} \ No newline at end of file +} diff --git a/src/webparts/reactTeamsTabsPnpjs/components/ReactTeamsTabsPnpjs.tsx b/src/webparts/reactTeamsTabsPnpjs/components/ReactTeamsTabsPnpjs.tsx index ee21531ae..252ef65b7 100644 --- a/src/webparts/reactTeamsTabsPnpjs/components/ReactTeamsTabsPnpjs.tsx +++ b/src/webparts/reactTeamsTabsPnpjs/components/ReactTeamsTabsPnpjs.tsx @@ -2,24 +2,93 @@ import * as React from 'react'; import styles from './ReactTeamsTabsPnpjs.module.scss'; import { IReactTeamsTabsPnpjsProps } from './IReactTeamsTabsPnpjsProps'; import { escape } from '@microsoft/sp-lodash-subset'; +import { Label } from 'office-ui-fabric-react/lib/Label'; +import { Pivot, PivotItem, IPivotProps, PivotLinkSize, PivotLinkFormat } from 'office-ui-fabric-react/lib/Pivot'; +import { FocusZone, FocusZoneDirection } from 'office-ui-fabric-react/lib/FocusZone'; +import { List } from 'office-ui-fabric-react/lib/List'; +import { Link } from 'office-ui-fabric-react/lib/Link'; +import { ITheme, mergeStyleSets, getTheme, getFocusStyle } from 'office-ui-fabric-react/lib/Styling'; -export default class ReactTeamsTabsPnpjs extends React.Component { - public render(): React.ReactElement { + +export interface IReactTeamsTabsPnpjsState { + pivotArray: any[]; +} +export default class ReactTeamsTabsPnpjs extends React.Component { + + constructor(props: IReactTeamsTabsPnpjsProps) { + super(props); + this.state = { + pivotArray: [] + }; + + + // sp.web.lists.getByTitle("Site Pages").items.filter("Is_x0020_Model eq 1").select("Title,FileRef").getAll().then((items: any[]) => { + // var tmpItems: any[] = new Array(); + // + // //DropDown initialization + // items.forEach(element => { + // var item = { key: element["FileRef"], text: element["Title"] }; + // tmpItems.push(item); + // }); + // + // this.setState({ allItems: tmpItems }); + // }); + + this._onRenderTabItem = this._onRenderTabItem.bind(this); + + } + + public render() { return ( -
-
-
-
- Welcome to SharePoint! -

Customize SharePoint experiences using Web Parts.

-

{escape(this.props.description)}

- - Learn more - +
+
+
+
+
+ {this.state.pivotArray} +
); } + public componentDidMount() { + var activeTasks: any[] = []; + var tmPpivotArray: any[] = []; + + + activeTasks.push({ name: 'a name', description: 'a desc' }); + activeTasks.push({ name: 'b name', description: 'b desc' }); + activeTasks.push({ name: 'c name', description: 'c desc' }); + + tmPpivotArray.push(this._renderPivotItemList(activeTasks, "test1")); + tmPpivotArray.push(this._renderPivotItemList(activeTasks, "test2")); + tmPpivotArray.push(this._renderPivotItemList(activeTasks, "test3")); + + + this.setState({ pivotArray: tmPpivotArray }); + } + + private _renderPivotItemList(channels: any[], tabName: string){ + return ( + + + + + + ); + } + + private _onRenderTabItem(item: any, index: number | undefined) { + return ( +
+
+
{item.name}
+ it renders as an anchor tag. +
{item.description}
+
+
+ ); + } }