Skip to content

Instantly share code, notes, and snippets.

View dimitrisnl's full-sized avatar
πŸ†—
Computer

Dimitrios Lytras dimitrisnl

πŸ†—
Computer
View GitHub Profile
import { apiService } from 'utils/api'
export const requestMemberInterests = (params) => {
return apiService.get(`/path/to/happiness`, { params })
}
export const requestMemberSubscriptions = (params) => {
return apiService.get(`/path/to/happiness`, { params })
}
import axios from 'axios'
import qs from 'qs'
const API_URL = process.env.API_URL
// const OTHER_API_URL = pricess.env.OTHER_API_URL
axios.defaults.headers.common.Accept = 'application/json'
// Instances -----------------------------------------
export const apiService = axios.create({
.
β”œβ”€ src
β”‚ β”œβ”€ assets/
β”‚ β”‚ β”œβ”€ fonts/
β”‚ β”‚ β”œβ”€ styles/
β”‚ β”‚ β”‚ β”œβ”€ partials/
β”‚ β”‚ β”‚ β”‚ β”œβ”€ _common.scss # Common styling, e.g anchors.
β”‚ β”‚ β”‚ β”‚ β”œβ”€ (_tables.scss) # Element stylings that get too lengthy
β”‚ β”‚ β”‚ β”‚ β”œβ”€ _layout.scss # CSS not suitable in layout/components scoped css
β”‚ β”‚ β”‚ β”‚ β”œβ”€ _helpers.scss # If not using bootstrap 4 helpers
const Link = (props) => {
let className = `link link--${props.theme}-theme`;
if (!props.underline) className += ' link--no-underline';
return <a href={props.href} className={className}>{props.children}</a>;
};
Link.propTypes = {
theme: PropTypes.oneOf([