This file contains 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
.loading-spin { | |
height: 5rem; | |
width: 5rem; | |
border: 0.6rem solid green; | |
border-radius: 50%; | |
border-top-color: transparent; | |
animation: spin 0.6s linear infinite; | |
} | |
@keyframes spin { |
This file contains 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 { | |
FormControl, | |
FormGroup, | |
NonNullableFormBuilder | |
} from '@angular/forms'; | |
// 👇 This is a helper to bind any interface with the FormGroup generating a type safe form matching existing keys and FormControl type 🙂 | |
export type WithControlsFrom<T> = { | |
[P in keyof T]?: FormControl<T[P]>; | |
}; |
This file contains 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 { | |
HttpEvent, | |
HttpHandler, | |
HttpHeaders, | |
HttpRequest, | |
} from '@angular/common/http'; | |
import { | |
HttpClientTestingModule, | |
HttpTestingController, | |
} from '@angular/common/http/testing'; |
This file contains 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 { | |
Directive, | |
ElementRef, | |
EventEmitter, | |
Input, | |
OnDestroy, | |
OnInit, | |
Output, | |
} from '@angular/core'; | |
import { Observable, Subscription, debounceTime } from 'rxjs'; |
This file contains 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
body { | |
display: grid; | |
grid-template-areas: | |
'header' | |
'main' | |
'footer'; | |
grid-template-columns: auto; | |
grid-template-rows: auto 1fr auto; | |
min-height: 100vh; | |
} |
This file contains 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
$separator: '\\:' !default; | |
@mixin theme-colors-props-shades($name, $prop, $colors, $shades) { | |
@each $color in $colors { | |
@each $shade in $shades { | |
.#{$name}-#{$color}-#{$shade} { | |
#{$prop}: var(--#{$color}-#{$shade}); | |
} | |
} |
This file contains 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
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
/* CSS */ | |
This file contains 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
/** | |
* Remove duplicates by property | |
* @param {string} property - List property identifier. | |
* @param {T[]} oldList - Old list | |
* @param {T[]} newList - New list | |
* @returns {T[]} Returns a new list without duplicates by property passed | |
*/ | |
export const removeDuplicatesByProperty = <T>( | |
property: keyof T, | |
oldList: T[] = [], |
This file contains 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
/** | |
* Create an object composed without ommited object properties | |
* @param {Object} object | |
* @param {string} keys | |
* @returns {Object} | |
*/ | |
const omit = (obj, ...keys) => Object.fromEntries( | |
Object.entries(obj) | |
.filter(([key]) => !keys.includes(key)) | |
); |
This file contains 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 { Context, createContext, useContext } from 'react'; | |
import { render, screen } from '@/test/testUtils'; | |
import { ComponentWithChildren, composer } from '.'; | |
type ContextTuple = [Context<string>, ComponentWithChildren]; | |
const createMockContext = (value: string): ContextTuple => { | |
const MockContext: Context<string> = createContext(''); | |
const MockContextProvider: ComponentWithChildren = ({ children }) => ( | |
<MockContext.Provider value={value}>{children}</MockContext.Provider> |
NewerOlder