Skip to content

Instantly share code, notes, and snippets.

View vman's full-sized avatar
👨‍💻

Vardhaman Deshpande vman

👨‍💻
View GitHub Profile
import * as React from 'react';
import { ServiceScope } from '@microsoft/sp-core-library';
import { withServiceScope } from '../common/withServiceScope';
import { MSGraphClientFactory, MSGraphClient } from '@microsoft/sp-http';
interface IHelloUserProps {
serviceScope: ServiceScope;
}
interface IHelloUserState {
using Microsoft.Graph;
using Microsoft.Identity.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Headers;
using System.Threading.Tasks;
namespace Graph.SPO.Thumbnails
{

https://graph.microsoft.com/v1.0/sites/your-site-id/lists/Site%20Pages/drive/root:/MySPOModernPage.aspx:?expand=thumbnails&select=thumbnails/large

import * as React from 'react';
import { IHelloWorldProps } from './IHelloWorldProps';
import { CustomOfficeUiFabricLibrary, ButtonComponent } from 'spfx-lib-ouifr';
export default class HelloWorld extends React.Component<IHelloWorldProps, {}> {
private myInstance;
constructor(props){
export { CustomOfficeUiFabricLibrary } from './libraries/customOfficeUiFabric/CustomOfficeUiFabricLibrary';
export { ButtonComponent } from './libraries/customOfficeUiFabric/ButtonComponent';
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json",
"version": "2.0",
"bundles": {
"custom-office-ui-fabric-library": {
"components": [
{
"entrypoint": "./lib/index.js",
"manifest": "./src/libraries/customOfficeUiFabric/CustomOfficeUiFabricLibrary.manifest.json"
}
import * as React from 'react';
import { DefaultButton, Label, PrimaryButton } from 'office-ui-fabric-react';
interface IButtonComponentProps {
primaryButtonText: string;
defaultButtonText: string;
}
export class ButtonComponent extends React.Component<IButtonComponentProps, {}> {
public render(): JSX.Element {
@vman
vman / SPFxServiceScope.md
Last active January 30, 2025 20:44
Tech Note: ServiceScope API
const counterServiceInstance: ICounterService = this.context.serviceScope.consume(CounterService.serviceKey);
const currentCounterValue : string = `Current counter value: ${counterServiceInstance.increaseAndReturnCount()}`;
this.domElement.getElementsByClassName("counterValue")[0].textContent = currentCounterValue;
@vman
vman / gs
Created February 8, 2019 20:50
gulp serve