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
function importAll(r) { | |
return r.keys().map(r); | |
} | |
const images = importAll(require.context('../assets/logos', false, /\.(png|jpe?g|svg)$/)); | |
const companies = images.map(item => { | |
return { | |
logo: item.default, | |
slug: 'company-page', |
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
// update - useState - useEffect | |
const defaultRadioVal = !loadingUser && | |
userMetaFields.company_member_flag && | |
userMetaFields.company_member_flag.meta_value || '0'; | |
const [ radioValue, setRadioValue ] = useState(defaultRadioVal); | |
useEffect(() => { | |
setRadioValue(defaultRadioVal) |
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
// apollo, read cahe, refetch query, update cashe | |
import { useApolloClient, gql } from '@apollo/client'; | |
//вычитываем из кеша квери: | |
const client = useApolloClient(); | |
const cache = client.cache; | |
const getMeCashe = cache.readQuery({ |
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 React, { useState } from "react"; | |
//Способ 1 | |
const Example = () => { | |
const [ isActive, setActive ] = useState(false); | |
const handleToggle = (e) => { | |
e.preventDefault(); | |
setActive(!isActive); |
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
// РАБОТА с кешем аполло: | |
// "apollo-boost": "^0.4.4", | |
// "apollo-cache-inmemory": "^1.6.3", | |
// "apollo-client": "^2.6.4", | |
// "apollo-link-context": "^1.0.19", | |
// "apollo-link-http": "^1.5.16", | |
// "apollo-upload-client": "^11.0.0", | |
// "graphql": "^14.5.7", |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>custom input number</title> | |
<style> | |
.quantity { |
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 React from "react"; | |
// import { Radio, Button } from 'antd'; | |
import VisualChart from './visual-chart'; | |
// Hooks | |
import { useQueryCharts } from './hooks/useQueryCharts'; | |
//CSS | |
import './charts.scss'; |
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
// Core | |
import React from 'react'; | |
// Hooks | |
import { useQueryAllAvailablePets } from './hooks/useQueryAllAvailablePets'; | |
export const SpecialList = () => { | |
//pets: data && data.allAvailablePets from custom hooks | |
const { getAllAvailablePets, loading, error, pets } = useQueryAllAvailablePets(); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>modal window</title> | |
<style> | |
body.open-modal { |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>grid area</title> | |
<style> | |
.links-block { | |
column-gap: 0; |