Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
const algoliasearch = require('algoliasearch'); | |
const { createClient } = require('@supabase/supabase-js'); | |
// Initialize Algolia client | |
const algoliaClient = algoliasearch('ALGOLIA_APP_ID', 'ALGOLIA_API_KEY'); | |
const index = algoliaClient.initIndex('INDEX_NAME'); | |
// Initialize Supabase client | |
const supabaseUrl = 'SUPABASE_URL'; | |
const supabaseKey = 'SUPABASE_SERVICE_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 { Component, OnInit } from '@angular/core'; | |
import { ModalService } from './modal.service'; | |
@Component({ | |
selector: 'app-notification', | |
templateUrl: './notification.component.html', | |
styleUrls: ['./notification.component.css'] | |
}) | |
export class NotificationComponent implements OnInit { |
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
<app-modal | |
title="Notification" | |
subHeading="Success" | |
modalName="notification"> | |
<p>Here is our notification, this could also be an @Input on the modal.</p> | |
</app-modal> |
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
<div | |
class="modal" | |
[ngClass]="className" | |
[class.modal--open]="(toggleModal | async) === modalName" | |
> | |
<div class="modal__overlay" (click)="closeModal()"></div> | |
<div class="modal__container"> | |
<div class="modal__body"> | |
<button | |
class="close-button modal__close js-modal-close" |
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 { Component, OnInit, Input } from '@angular/core'; | |
import { ModalService } from './modal/modal.service'; | |
import { BehaviorSubject } from 'rxjs'; | |
@Component({ | |
selector: 'app-modal', | |
templateUrl: './modal.component.html', | |
styleUrls: ['./modal.component.css'] | |
}) | |
export class ModalComponent implements OnInit { |
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 { Injectable } from '@angular/core'; | |
import { BehaviorSubject } from 'rxjs'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class ModalService { | |
// Set inital state of modal to none | |
toggalModal: BehaviorSubject<string> = new BehaviorSubject('none'); |
NewerOlder