Skip to content

Instantly share code, notes, and snippets.

View DanielHoffmann's full-sized avatar

Daniel Hoffmann Bernardes DanielHoffmann

  • Northvolt AB
  • Stockholm, Sweden
View GitHub Profile

gmFeedWidget Guide

The Globalmouth feedwidget is a widget showing sports events from the Kambi Sportsbook API. The events shown are requested from a CMS to determine which events to show. The widget alternates views between live and pre-match events on a sliding animation.

Javascript Bundle URL

A script tag needs to be included in the page that is going to show the feed-widget:

export GOPATH=/Users/danielhoffmannbernardes/dev/go
# ZSH stuff
export ZSH=/Users/danielhoffmannbernardes/.oh-my-zsh
ZSH_THEME="robbyrussell"
plugins=(
git
)
source $ZSH/oh-my-zsh.sh
import React, { useContext, useMemo, useState } from 'react';
interface ExampleContextValue {
value: number;
setValue: (newValue: number) => void;
}
const ExampleContext = React.createContext<ExampleContextValue | undefined>(
undefined,
);
const cwd = process.cwd()
module.exports = function requireResolve(moduleName) {
const resolveOpts = {
paths: [
// will prefer this folder:
path.resolve(cwd, '..', 'some-dep', 'node_modules'),
// over this folder:
path.resolve(cwd, 'node_modules'),
],
module.exports = {
ignorePatterns: [
'config/**/*',
'**/build/**/*',
'**/.yarn/**/*',
'**/artifacts/**/*',
'**/storybook-static/**/*',
'**/node_modules/**/*',
'**/*.config.js',
'**/*rc.js',
// used so eslint-plugin-import can properly resolve dependencies using yarn2
let pnp
try {
pnp = require(`./.pnp.cjs`)
} catch (error) {
// not a problem
}
import { Suspense, useEffect, useState } from 'react'
import { ErrorBoundary } from './components/ErrorBoundary'
import { Loader } from './components/Loader'
export function App() {
const [search, setSearch] = useState<string>('')
const [debouncedSearch, setDebouncedSearch] = useState<string>('')
useEffect(() => {
const timeout = setTimeout(() => {
import { createBrowserRouter, RouteObject } from 'react-router-dom'
const routes = [
myRoute1,
myRoute2,
myRoute3,
] satisfies RouteObject[]
type Route = {
type A = {
a: string
b: string
}
const c = {
a: 'a',
b: 'b',
c: 'c'