All files / icons toast-icons.js

0% Statements 0/15
0% Branches 0/7
0% Functions 0/2
0% Lines 0/12
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49                                                                                                 
import React from 'react'
 
const ToastTypeIcon = (props) => {
  let Icon = null
 
  switch (props.type) {
    case 'success':
      Icon = (
        <svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'>
          <g fill='#6F9E32' fillRule='evenodd'>
            <path d='M11 15a.5.5 0 0 1-.332-.126l-4.5-4a.5.5 0 1 1 .664-.748l4.138 3.678 8.167-8.647a.5.5 0 1 1 .726.686l-8.5 9.001A.5.5 0 0 1 11 15' />
            <path d='M11 21c-4.962 0-9-4.037-9-9 0-4.962 4.038-9 9-9 1.683 0 3.33.476 4.766 1.375a.5.5 0 0 1-.532.848A7.964 7.964 0 0 0 11 4c-4.411 0-8 3.589-8 8s3.589 8 8 8 8-3.589 8-8c0-.782-.123-1.573-.365-2.352a.5.5 0 1 1 .955-.296c.272.875.41 1.766.41 2.648 0 4.963-4.037 9-9 9' />
          </g>
        </svg>
      )
      break
 
    case 'warning':
      Icon = (
        <svg height='24px' version='1.1' viewBox='0 0 32 32' width='24px' xmlns='http://www.w3.org/2000/svg' >
          <title />
          <desc />
          <defs />
          <g fill='none' fillRule='evenodd' id='Page-1' stroke='none' strokeWidth='1'>
            <g fill='#e8b007' id='icon-61-warning'>
              <path d='M15.4242327,5.14839275 C16.2942987,3.74072976 17.707028,3.74408442 18.5750205,5.14839275 L29.3601099,22.59738 C30.5216388,24.4765951 29.6755462,26 27.4714068,26 L6.5278464,26 C4.32321557,26 3.47386317,24.4826642 4.63914331,22.59738 L15.4242327,5.14839275 L15.4242327,5.14839275 Z M16.353181,5.5229211 C16.7005152,4.96165163 17.2647678,4.9634187 17.6110318,5.52292108 L28.6162937,23.3055078 C29.1954663,24.2413498 28.7622271,24.9999996 27.6746349,24.9999996 L6.29039231,25 C5.19115596,25 4.76644971,24.2463265 5.34866262,23.3055082 L16.353181,5.5229211 L16.353181,5.5229211 Z M17,11 C16.4477153,11 16,11.4530363 16,11.9970301 L16,18.0029699 C16,18.5536144 16.4438648,19 17,19 C17.5522847,19 18,18.5469637 18,18.0029699 L18,11.9970301 C18,11.4463856 17.5561352,11 17,11 L17,11 Z M17,23 C17.5522848,23 18,22.5522848 18,22 C18,21.4477152 17.5522848,21 17,21 C16.4477152,21 16,21.4477152 16,22 C16,22.5522848 16.4477152,23 17,23 L17,23 Z' id='warning' />
            </g>
          </g>
        </svg>
      )
      break
 
    case 'error':
      Icon = (
        <svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'>
          <g fill='#fc5457' fillRule='evenodd'>
            <path d='M12 20c-4.411 0-8-3.589-8-8s3.589-8 8-8 8 3.589 8 8-3.589 8-8 8m0-17c-4.962 0-9 4.038-9 9 0 4.963 4.038 9 9 9 4.963 0 9-4.037 9-9 0-4.962-4.037-9-9-9' />
            <path d='M15.854 8.146a.5.5 0 0 0-.707 0l-3.148 3.146-3.146-3.146a.5.5 0 0 0-.707.707l3.146 3.148-3.146 3.146a.5.5 0 0 0 .707.707L12 12.708l3.147 3.146a.498.498 0 0 0 .707 0 .5.5 0 0 0 0-.707L12.707 12l3.146-3.147a.5.5 0 0 0 0-.707' />
          </g>
        </svg>
      )
      break
  }
 
  return (Icon)
}
 
export default ToastTypeIcon