-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from The-Bugger-Ducks/development
Development (sprint 02)
- Loading branch information
Showing
88 changed files
with
3,123 additions
and
1,273 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"presets": ["module:metro-react-native-babel-preset"], | ||
"plugins": [ | ||
[ | ||
"babel-plugin-inline-import", | ||
{ | ||
"extensions": [".svg"] | ||
} | ||
] | ||
] | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
declare module "*.svg" { | ||
import React from "react"; | ||
import { SvgProps } from "react-native-svg"; | ||
const content: React.FC<SvgProps>; | ||
export default content; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const { getDefaultConfig } = require("metro-config"); | ||
|
||
module.exports = (async () => { | ||
const { | ||
resolver: { sourceExts, assetExts }, | ||
} = await getDefaultConfig(); | ||
return { | ||
transformer: { | ||
babelTransformerPath: require.resolve("react-native-svg-transformer"), | ||
}, | ||
resolver: { | ||
assetExts: assetExts.filter(ext => ext !== "svg"), | ||
sourceExts: [...sourceExts, "svg"], | ||
}, | ||
}; | ||
})(); |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
// import { SvgProps } from "react-native-svg"; | ||
|
||
import checkIcon from "../../shared/assets/icons/check.svg"; | ||
import checkboxOffIcon from "../../shared/assets/icons/checkbox-off.svg"; | ||
import checkboxOnIcon from "../../shared/assets/icons/checkbox-on.svg"; | ||
import closeIcon from "../../shared/assets/icons/close.svg"; | ||
import editIcon from "../../shared/assets/icons/edit.svg"; | ||
import eyeHiddenIcon from "../../shared/assets/icons/eye-hidden.svg"; | ||
import eyeIcon from "../../shared/assets/icons/eye.svg"; | ||
import homeIcon from "../../shared/assets/icons/home.svg"; | ||
import imageIcon from "../../shared/assets/icons/image.svg"; | ||
import infoIcon from "../../shared/assets/icons/info.svg"; | ||
import loadingIcon from "../../shared/assets/icons/loading.svg"; | ||
import logOffIcon from "../../shared/assets/icons/log-off.svg"; | ||
import menuIcon from "../../shared/assets/icons/menu.svg"; | ||
import minusIcon from "../../shared/assets/icons/minus.svg"; | ||
import orderIcon from "../../shared/assets/icons/order.svg"; | ||
import plusIcon from "../../shared/assets/icons/plus.svg"; | ||
import profileIcon from "../../shared/assets/icons/profile.svg"; | ||
import questionIcon from "../../shared/assets/icons/question.svg"; | ||
import radio1Icon from "../../shared/assets/icons/radio-1.svg"; | ||
import radioIcon from "../../shared/assets/icons/radio.svg"; | ||
import refreshIcon from "../../shared/assets/icons/refresh.svg"; | ||
import searchIcon from "../../shared/assets/icons/search.svg"; | ||
import trashIcon from "../../shared/assets/icons/trash.svg"; | ||
import usersIcon from "../../shared/assets/icons/users.svg"; | ||
import arrowLeftIcon from "../../shared/assets/icons/arrow-left.svg"; | ||
|
||
export type iconsName = | ||
| "arrow-left" | ||
| "check" | ||
| "checkbox-off" | ||
| "checkbox-on" | ||
| "close" | ||
| "edit" | ||
| "eye-hidden" | ||
| "eye" | ||
| "home" | ||
| "image" | ||
| "info" | ||
| "loading" | ||
| "log-off" | ||
| "menu" | ||
| "minus" | ||
| "order" | ||
| "plus" | ||
| "profile" | ||
| "question" | ||
| "radio-1" | ||
| "radio" | ||
| "refresh" | ||
| "search" | ||
| "trash" | ||
| "users"; | ||
|
||
interface Icon { | ||
name: iconsName; | ||
image: any; | ||
// image: React.FC<SvgProps> | ||
} | ||
|
||
export const iconList: Icon[] = [ | ||
{ image: arrowLeftIcon, name: "arrow-left" }, | ||
{ image: checkIcon, name: "check" }, | ||
{ image: checkboxOffIcon, name: "checkbox-off" }, | ||
{ image: checkboxOnIcon, name: "checkbox-on" }, | ||
{ image: closeIcon, name: "close" }, | ||
{ image: editIcon, name: "edit" }, | ||
{ image: eyeHiddenIcon, name: "eye-hidden" }, | ||
{ image: eyeIcon, name: "eye" }, | ||
{ image: homeIcon, name: "home" }, | ||
{ image: imageIcon, name: "image" }, | ||
{ image: infoIcon, name: "info" }, | ||
{ image: loadingIcon, name: "loading" }, | ||
{ image: logOffIcon, name: "log-off" }, | ||
{ image: menuIcon, name: "menu" }, | ||
{ image: minusIcon, name: "minus" }, | ||
{ image: orderIcon, name: "order" }, | ||
{ image: plusIcon, name: "plus" }, | ||
{ image: profileIcon, name: "profile" }, | ||
{ image: questionIcon, name: "question" }, | ||
{ image: radio1Icon, name: "radio-1" }, | ||
{ image: radioIcon, name: "radio" }, | ||
{ image: refreshIcon, name: "refresh" }, | ||
{ image: searchIcon, name: "search" }, | ||
{ image: trashIcon, name: "trash" }, | ||
{ image: usersIcon, name: "users" }, | ||
]; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { SvgXml } from "react-native-svg"; | ||
|
||
import { iconList, iconsName } from "./icons"; | ||
|
||
import InfoIcon from "../../shared/assets/icons/info.svg"; | ||
|
||
interface IconProps { | ||
icon: iconsName; | ||
size?: number; | ||
width?: number; | ||
height?: number; | ||
fillColor?: string; | ||
strokeColor?: string; | ||
} | ||
|
||
export function Icon({ | ||
icon, | ||
size, | ||
width = 24, | ||
height = 24, | ||
strokeColor, | ||
fillColor, | ||
}: IconProps) { | ||
function getIcon() { | ||
const svgFile = iconList.find(item => item.name == icon); | ||
|
||
if (svgFile) return svgFile.image; | ||
|
||
return InfoIcon; | ||
} | ||
|
||
return ( | ||
<SvgXml | ||
xml={getIcon()} | ||
stroke={strokeColor} | ||
fill={fillColor} | ||
width={size || width} | ||
height={size || height} | ||
/> | ||
); | ||
} |
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
Oops, something went wrong.