Skip to content

Commit

Permalink
Merge branch 'main' into feat/wesh-import-export
Browse files Browse the repository at this point in the history
  • Loading branch information
sakul-budhathoki authored Feb 6, 2024
2 parents a321fc2 + 5f3b481 commit 4a0813f
Show file tree
Hide file tree
Showing 93 changed files with 6,068 additions and 84 deletions.
Binary file added assets/default-images/ava.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/default-images/guardian_profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/icons/black-check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions assets/icons/dot-more.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/icons/downArrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/external-link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/icons/files.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/icons/trash-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/icons/upArrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 36 additions & 14 deletions go/internal/indexerhandler/bunker_minter.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ type BunkerUpdateConfigMsg struct {
Payload struct {
Owner *string `json:"owner"`
SecondaryDuringMint *bool `json:"secondary_during_mint"`
NFTMaxSupply *string `json:"nft_max_supply"`
} `json:"update_config"`
}

Expand All @@ -170,26 +171,47 @@ func (h *Handler) handleExecuteBunkerUpdateConfig(e *Message, execMsg *wasmtypes
return errors.Wrap(err, "failed to unmarshal tns set_adming_address msg")
}

updates := make(map[string]interface{})
totalUpdates := 0

if msg.Payload.Owner != nil {
updates["CreatorAddress"] = *msg.Payload.Owner
}
if msg.Payload.SecondaryDuringMint != nil {
updates["SecondaryDuringMint"] = *msg.Payload.SecondaryDuringMint
{
updates := make(map[string]interface{})
if msg.Payload.Owner != nil {
updates["CreatorAddress"] = *msg.Payload.Owner
}
if len(updates) != 0 {
if err := h.db.
Model(&indexerdb.TeritoriCollection{}).
Where("collection_id = ?", h.config.Network.CollectionID(execMsg.Contract)).
UpdateColumns(updates).
Error; err != nil {
return errors.Wrap(err, "failed to update bunker creator")
}
totalUpdates += len(updates)
}
}

if len(updates) != 0 {
if err := h.db.
Model(&indexerdb.TeritoriCollection{}).
Where("collection_id = ?", h.config.Network.CollectionID(execMsg.Contract)).
UpdateColumns(updates).
Error; err != nil {
return errors.Wrap(err, "failed to update bunker creator")
{
updates := make(map[string]interface{})
if msg.Payload.SecondaryDuringMint != nil {
updates["SecondaryDuringMint"] = *msg.Payload.SecondaryDuringMint
}
if msg.Payload.NFTMaxSupply != nil {
updates["MaxSupply"] = *msg.Payload.NFTMaxSupply
}
if len(updates) != 0 {
if err := h.db.
Model(&indexerdb.Collection{}).
Where("id = ?", h.config.Network.CollectionID(execMsg.Contract)).
UpdateColumns(updates).
Error; err != nil {
return errors.Wrap(err, "failed to update bunker creator")
}
totalUpdates += len(updates)
}
h.logger.Info("updated bunker config")
}

h.logger.Info("updated bunker config", zap.Int("total-updates", totalUpdates))

return nil
}

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"react-native-paper": "^4.12.5",
"react-native-pell-rich-editor": "^1.8.8",
"react-native-pie-chart": "^3.0.1",
"react-native-popover-view": "^5.1.8",
"react-native-popup-menu": "^0.16.1",
"react-native-qrcode-svg": "^6.2.0",
"react-native-reanimated": "^3.6.2",
Expand Down Expand Up @@ -146,6 +147,7 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@axelar-network/axelarjs-types": "^0.33.0",
"@babel/core": "^7.23.3",
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
Expand Down
29 changes: 29 additions & 0 deletions packages/components/BoxDetailTeritori/BoxDetailTeritori.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from "react";

import { neutral77 } from "../../utils/style/colors";
import { fontSemibold12, fontSemibold14 } from "../../utils/style/fonts";
import { layout } from "../../utils/style/layout";
import { BrandText } from "../BrandText";
import { TertiaryBox } from "../boxes/TertiaryBox";

export const BoxDetailTeritori: React.FC<{
title: string;
descripation: string;
}> = ({ title, descripation }) => {
return (
<TertiaryBox
style={{
borderRadius: 6,
padding: layout.spacing_x1_5,
flex: 1,
}}
>
<BrandText style={[fontSemibold12, { color: neutral77 }]}>
{title}
</BrandText>
<BrandText style={[fontSemibold14, { marginTop: layout.spacing_x0_75 }]}>
{descripation}
</BrandText>
</TertiaryBox>
);
};
31 changes: 14 additions & 17 deletions packages/components/CollectionView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { StyleSheet, Linking, View, Pressable } from "react-native";

import { BrandText } from "./BrandText";
import { OptimizedImage } from "./OptimizedImage";
import { LegacyTertiaryBox } from "./boxes/LegacyTertiaryBox";
import { TertiaryBox } from "./boxes/TertiaryBox";
import { GradientText } from "./gradientText";
import { Collection, MintState } from "../api/marketplace/v1/marketplace";
import { useCollectionThumbnailInfo } from "../hooks/collection/useCollectionThumbnailInfo";
Expand All @@ -22,20 +22,24 @@ export const CollectionView: React.FC<{
size?: CollectionViewSize;
linkToMint?: boolean;
mintState: number;
width?: number;
onPress?: () => void;
}> = ({ item, size = "XL", linkToMint, mintState, onPress }) => {
}> = ({ item, size = "XL", linkToMint, mintState, onPress, width }) => {
const navigateToCollection = useNavigateToCollection(item.id, {
forceSecondaryDuringMint: item.secondaryDuringMint,
forceLinkToMint: linkToMint,
});
const sizedStyles = useMemo(() => StyleSheet.flatten(styles[size]), [size]);
width = typeof width === "number" ? width : sizedStyles.box.width;

const navigateToTwitter = () => {
Linking.openURL(item.twitterUrl);
};

const info = useCollectionThumbnailInfo(item.id);

const imgSize = width - sizedStyles.boxMainContainer.paddingVertical * 2;

return (
<Pressable
onPress={() => {
Expand All @@ -45,19 +49,14 @@ export const CollectionView: React.FC<{
}}
disabled={item.id === "" && item.twitterUrl === ""}
>
<LegacyTertiaryBox
noBrokenCorners={size === "XS"}
mainContainerStyle={sizedStyles.boxMainContainer}
width={sizedStyles.box.width}
height={sizedStyles.box.height}
>
<TertiaryBox style={[sizedStyles.boxMainContainer, { width }]}>
<OptimizedImage
sourceURI={item.imageUri}
width={sizedStyles.image.width}
height={sizedStyles.image.height}
width={250}
height={250}
style={{
width: sizedStyles.image.width,
height: sizedStyles.image.height,
width: imgSize,
height: imgSize,
alignSelf: "center",
borderRadius: sizedStyles.image.borderRadius,
}}
Expand Down Expand Up @@ -139,7 +138,7 @@ export const CollectionView: React.FC<{
)}
</View>
</View>
</LegacyTertiaryBox>
</TertiaryBox>
</Pressable>
);
};
Expand All @@ -151,8 +150,7 @@ const styles = {
height: COLLECTION_VIEW_XL_HEIGHT,
},
boxMainContainer: {
paddingTop: layout.spacing_x1_5,
paddingBottom: layout.spacing_x2_5,
paddingVertical: layout.spacing_x2,
},
image: {
width: COLLECTION_VIEW_XL_WIDTH - 24,
Expand Down Expand Up @@ -180,8 +178,7 @@ const styles = {
height: COLLECTION_VIEW_SM_HEIGHT,
},
boxMainContainer: {
paddingTop: layout.spacing_x1,
paddingBottom: layout.spacing_x1,
paddingVertical: layout.spacing_x2,
},
image: {
width: 108,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import React from "react";
import { View } from "react-native";

import { LeftContainer } from "./LeftContainer";
import { PaginationProps } from "./PaginationProps.type";
import { RightContainer } from "./RightContainer";
import { layout } from "../../../utils/style/layout";
import { SpacerRow } from "../../spacer";

export const AssetsPagination = ({
currentPage,
maxPage,
onChangePage,
}: PaginationProps) => {
const handleChangePage = (pageIndex: number) => {
if (pageIndex < 0) {
pageIndex = 0;
} else if (pageIndex >= maxPage) {
pageIndex = maxPage - 1;
}
if (pageIndex !== currentPage) {
onChangePage(pageIndex);
}
};

return (
<View
style={{
flexDirection: "row",
justifyContent: "space-around",
width: "100%",
paddingHorizontal: layout.spacing_x2,
}}
>
<LeftContainer
currentPage={currentPage}
maxPage={maxPage}
onChangePage={handleChangePage}
/>

<SpacerRow size={1} />

<RightContainer
currentPage={currentPage}
maxPage={maxPage}
onChangePage={handleChangePage}
/>
</View>
);
};
90 changes: 90 additions & 0 deletions packages/components/FilePreview/AssetsPagination/LeftContainer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import React from "react";
import { TextInput, View } from "react-native";

import { PaginationProps } from "./PaginationProps.type";
import {
neutral17,
neutral77,
secondaryColor,
} from "../../../utils/style/colors";
import { fontSemibold14 } from "../../../utils/style/fonts";
import { layout } from "../../../utils/style/layout";
import { BrandText } from "../../BrandText";
import { SEARCH_BAR_INPUT_HEIGHT } from "../../Search/SearchBarInput";
import { TertiaryBox } from "../../boxes/TertiaryBox";

export const LeftContainer = ({
currentPage,
maxPage,
onChangePage,
}: PaginationProps) => {
return (
<View style={{ flex: 1, flexDirection: "row" }}>
<View
style={{
flexDirection: "row",
alignItems: "center",
justifyContent: "flex-start",
}}
>
<BrandText
style={{
...fontSemibold14,
color: neutral77,
paddingRight: layout.spacing_x1,
lineHeight: layout.spacing_x2,
}}
>
Page {currentPage + 1} of {maxPage}
</BrandText>
</View>
<View
style={{
flexDirection: "row",
alignItems: "center",
justifyContent: "flex-start",
}}
>
<BrandText
style={{
...fontSemibold14,
color: neutral77,
paddingRight: layout.spacing_x1,
lineHeight: layout.spacing_x2,
}}
>
| Go to page:
</BrandText>
<TertiaryBox
style={[
{
flexDirection: "row",
paddingHorizontal: layout.spacing_x1_5,
backgroundColor: neutral17,
width: 80,
height: SEARCH_BAR_INPUT_HEIGHT,
alignItems: "center",
},
]}
>
<TextInput
defaultValue={(currentPage + 1).toString()}
inputMode="numeric"
style={[
fontSemibold14,
{
color: secondaryColor,
flex: 1,
width: 56,
},
{ outlineStyle: "none" } as any,
]}
onSubmitEditing={(value) => {
onChangePage(+value.nativeEvent.text - 1);
}}
/>
</TertiaryBox>
</View>
</View>
);
};
Loading

0 comments on commit 4a0813f

Please sign in to comment.