Git Product home page Git Product logo

git-report-web's Introduction

Hi, I'm Adrien NF!

LinkedInย 

French web engineer, always on the move to improve the world!
Working from around the world ๐ŸŒ

๐Ÿ’ป

๐Ÿธ

Hailing from France, I now work as a web developer in Canada. I'm always looking to improve, and become a better version of myself. Currently upgrading to me 2.0!

  • ๐ŸŒฑ Iโ€™m currently learning Korean ๐Ÿ‡ฐ๐Ÿ‡ท.
  • ๐Ÿ‘ฏ Iโ€™m looking to collaborate on any project that might be fun!

git-report-web's People

Contributors

adrien-nf avatar nathangobinet avatar

Stargazers

 avatar  avatar

Watchers

 avatar

git-report-web's Issues

CssBaseline should be at root

Correct order is

<React.StrictMode>
  <ThemeProvider>
    <CSSBaseline />
 

to avoid snackbar context ignoring CSSBaseline

Useless dependency notistack

MUI have a snackbar component

Simple implementation

import { Alert, AlertColor, Slide, SlideProps, Snackbar } from '@mui/material';
import React, { createContext, useContext, useState } from 'react';

interface SnackAlert {
  message: string,
  autoHideDuration?: number,
  severity: AlertColor,
}

interface SnackContextSpec {
  success: (message: string) => void,
  error: (message: string) => void,
}

const SnackContext = createContext<SnackContextSpec | undefined>(undefined);

function SlideTransition(props: SlideProps) {
  // eslint-disable-next-line react/jsx-props-no-spreading
  return <Slide {...props} direction="up" />;
}

function SnackContextProvider({ children }: { children: React.ReactNode }) {
  const [open, setOpen] = useState(false);
  const [snackAlert, setSnackAlert] = useState<SnackAlert>();

  const handleClose = (event?: React.SyntheticEvent | Event, reason?: string) => {
    if (reason === 'clickaway') return;
    setOpen(false);
  };

  const success = (newMessage: string) => {
    setSnackAlert({
      message: newMessage,
      severity: 'success',
      autoHideDuration: 4000,
    });
    setOpen(true);
  };

  const error = (newMessage: string) => {
    setSnackAlert({
      message: newMessage,
      severity: 'error',
    });
    setOpen(true);
  };

  return (
    <SnackContext.Provider value={{ error, success }}>
      <Snackbar
        anchorOrigin={{
          vertical: 'bottom',
          horizontal: 'center',
        }}
        TransitionComponent={SlideTransition}
        open={open}
        autoHideDuration={snackAlert?.autoHideDuration}
        onClose={handleClose}
      >
        <Alert
          onClose={handleClose}
          severity={snackAlert?.severity}
          sx={{ width: '100%' }}
        >
          {snackAlert?.message}
        </Alert>
      </Snackbar>
      {children}
    </SnackContext.Provider>
  );
}

export default SnackContextProvider;

export function useSnack(): SnackContextSpec {
  const context = useContext(SnackContext);
  if (!context) throw new Error('Using snack context outside of provider');
  return context;
}

Update script url

Maybe remove https ?
Shorter & clearer without imo

-  sh -c "$(curl -fsSL https://git-report.com/api/script/4602db45-b61e-c34c-0de4-10d63cf6d206)"
+  sh -c "$(curl -fsSL git-report.com/api/script/4602db45-b61e-c34c-0de4-10d63cf6d206)"

Use correct spacing

The spacing should be the same as on the mockups.

See title, sections, footer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.