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
export default class BaseTemplate extends React.Component { | |
setValue = (e) => { | |
const obj = {}; | |
obj[e.target.name] = e.target.value; | |
this.setState(obj); | |
} | |
someOtherGlobalFunction() { | |
..... | |
} |
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
export default class SomethingView extends BaseTemplate { | |
// You can always overide the other class functions | |
renderFooter() { | |
return ( | |
<div> | |
...coool footer | |
</div> | |
); | |
} |
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 React from 'react'; | |
import Header from "../components/Header" | |
import Footer from "../components/Footer" | |
import LanguageChanger from "../components/LanguageChanger/index" | |
import { LangContext } from "../context" | |
class MainTemplate extends React.Component { | |
constructor(props) { | |
super(props); |
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 App = ({ routes, initialData, initialToken, menus }) => ( | |
<Switch> | |
{routes.map((route, index) => { | |
// pass in the initialData from the server or window.DATA for this | |
// specific route | |
return ( | |
<Route | |
key={index} | |
path={route.path} |
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 { Accounts } from "meteor/accounts-base"; | |
class blue { | |
call(name, params) { | |
return new Promise((resolve, reject) => { | |
Meteor.call(name, params, (err, resp) => { | |
if (err) reject(err); | |
else resolve(resp); | |
}); | |
}); |
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 React from "react"; | |
import Bluelagoon from ".."; | |
import useConfirm from "../../hooks/useConfirm"; | |
import useNotification from "../../hooks/useNotification"; | |
import { useNotify } from "../../NotifyContext"; | |
function useBluelagoonPromise({ | |
method, | |
defaultData, | |
notifyError, |
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
export default function ModalContent({ closeModal, onChange, factoryId }) { | |
const [_t] = useTranslation(); | |
const [state, dispatch] = React.useReducer(reducer, initialState); | |
const [feriaValue, feriaInput, setFeriaInput] = useInput({ | |
type: "text", | |
label: _t("Fair"), | |
placeholder: _t("Enter the fair or season your products belong to"), | |
rules: { | |
isRequired: true, |
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 React from "react"; | |
import { CSSTransition } from "react-transition-group"; | |
import ModalPortal from "../ModalPortal"; | |
export function useModal() { | |
const [isModalVisible, setIsModalVisitble] = React.useState(false); | |
const toggleModal = () => { | |
setIsModalVisitble((prevState) => !prevState); | |
}; | |
const closeModal = () => { |
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 React, { useContext, createContext, useState, useRef } from "react"; | |
import { useParams } from "react-router-dom"; | |
import useBluelagoon from "../bluelagon/hooks/useBluelagoon"; | |
const SomethingContext = createContext(); | |
function useProvideSomething() { | |
const { id } = useParams(); | |
const { wrappedApi, isLoading, error, response } = useBluelagoon({ |