This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const path = require('path'); | |
| module.exports = { | |
| "stories": [ | |
| "../.stories/**/*.stories.mdx", | |
| "../.stories/**/*.stories.@(js|jsx|ts|tsx)" | |
| ], | |
| "addons": [ | |
| "@storybook/addon-links", | |
| "@storybook/addon-essentials", | |
| "storybook-addon-pseudo-states", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { addons } from '@storybook/addons'; | |
| addons.setConfig({ | |
| isFullscreen: false, | |
| showNav: true, | |
| showPanel: true, | |
| panelPosition: 'right', | |
| enableShortcuts: true, | |
| isToolshown: true, | |
| initialActive: 'sidebar', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // You are given a string S consisting of characters 0, 1, and ?. | |
| // You can replace each ? with either 0 or 1. Your task is to find | |
| // if it is possible to assign each ? to either 0 or 1 such that the resulting | |
| // string has no substrings that are palindromes of length 5 or more. | |
| /** For checking if a string is palindrom or not */ | |
| function isPalindrome(string) { | |
| return string == string.split("").reverse().join(""); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div class="app"> | |
| <button | |
| :disabled="loading || !configurationExists" | |
| @click="login" | |
| > | |
| {{ ( loading || !configurationExists ) ? 'Please wait' : 'Continue with Google' }} | |
| </button> | |
| </div> | |
| </template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "serviceConfigurations": { | |
| "google": { | |
| "clientId": "YOUR_CLIENT_ID.apps.googleusercontent.com", | |
| "secret": "YOUR_SECRET", | |
| "loginStyle": "popup" | |
| } | |
| }, | |
| "env": "development" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // server/main.js | |
| Meteor.startup(() => { | |
| ServiceConfiguration.configurations.upsert( | |
| {service: 'google'}, | |
| { | |
| $set: { | |
| ...Meteor.settings.serviceConfigurations.google, | |
| }, | |
| }, | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** Functional Component */ | |
| import React, { useState, useEffect } from "react"; | |
| const FunctionalComponent = (props) => { | |
| const [x, setX] = useState(1); | |
| useEffect(() => { | |
| console.log("Functional Component Useeffect - Value of X --", x); | |
| }); | |
| return ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Handling Forms and different events | |
| * Conditional rendering | |
| * Looping in react | |
| */ | |
| import "./style.css"; | |
| import { useState } from "react"; | |
| const RenderResult = (props) => { | |
| const { showResult, firstName, removeHandler } = props; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useState } from "react"; | |
| import { Link } from "react-router-dom"; | |
| const dogsListAPI = "https://dog.ceo/api/breeds/list/all"; | |
| const DogsComponent = () => { | |
| const [breeds, setBreeds] = useState([]); | |
| const [image, setImage] = useState(); | |
| const [currentBreed, setCurrentBreed] = useState(""); | |
| const getBreedsList = () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Handling Forms and different events | |
| * Conditional rendering | |
| * Looping in react | |
| */ | |
| // import "./style.css"; | |
| import { useState, createRef } from "react"; | |
| const RenderResult = (props) => { | |
| const { showResult, firstName, removeHandler } = props; | |
| const arrayOfCharacters = firstName.split(""); |