Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robertov8/google-classroom-share
Classroom share button to your website, you allow your users to share your content to their classes and drive traffic to your site.
https://github.com/robertov8/google-classroom-share
google-classroom npm package react
Last synced: about 4 hours ago
JSON representation
Classroom share button to your website, you allow your users to share your content to their classes and drive traffic to your site.
- Host: GitHub
- URL: https://github.com/robertov8/google-classroom-share
- Owner: robertov8
- Created: 2020-09-04T00:44:18.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-12T19:40:07.000Z (over 3 years ago)
- Last Synced: 2024-11-02T14:51:44.146Z (5 days ago)
- Topics: google-classroom, npm, package, react
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/google-classroom-share
- Size: 7.77 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# google-classroom-share
You can add and customize the Classroom share button to meet the needs of your
website, such as modifying the button size and load technique. By adding the Classroom
share button to your website, you allow your users to share your content to their
classes and drive traffic to your site.# Install
```
yarn add google-classroom-share react-load-script
```# Demo
![](./assets/sharebutton.gif)
https://robertov8.github.io/google-classroom-sharehttps://developers.google.com/classroom/guides/sharebutton
# Usage
```javascript
import React from 'react';import GoogleShareToClassRoom from '../index';
function App() {
return (
console.log(`GoogleShareToClassRoom:${type}`)}
onShareComplete={() => console.log('GoogleShareToClassRoom:onShareComplete')}
onShareStart={() => console.log('GoogleShareToClassRoom:onShareStart')}
/>
);
}export default App;
```## Props
| Prop | Type | Description
| --------------- | -------- | -----------
| body | String | Sets the item body text to share to Classroom.
| itemType | String | "announcement, assignment, material, question" This will automatically show the creation dialog after the user first selects a course (or immediately if courseid is also specified).
| url | String | Sets the URL to share to Classroom. If you set this attribute by using gapi.sharetoclassroom.render, you should not escape the URL.
| size | Number | Sets the size in pixels of the share button. If the size is omitted, the button uses 32.
| title | String | Sets the item title to share to Classroom.
| theme | String | Sets the button icon for the selected theme.
| onShare | String | If specified, sets the name of a function is called when the share dialog opens and user finishes sharing your link.
| onShareComplete | Function | If specified, sets the name of a function is called when the user finishes sharing your link.
| onShareStart | Function | If specified, sets the name of a function is called when the share dialog opens.