Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renderContent error in Accordion #412

Open
gugagranato opened this issue Jul 29, 2021 · 0 comments
Open

renderContent error in Accordion #412

gugagranato opened this issue Jul 29, 2021 · 0 comments

Comments

@gugagranato
Copy link

How I solve this in Accordion?

Look:

image

my renderContent function:

const renderContent = (section: TMonths) => {
    if (section.faturas.length > 0) {
      return section.faturas.map((fat: IFaturas) => (
        <View
          key={fat.id}
          style={{
            marginBottom: 6,
            marginTop: 6,
            width: '100%',
            flexDirection: 'row',
            justifyContent: 'space-between',
            paddingLeft: 8,
            paddingRight: 8,
            alignItems: 'center'
          }}
        >
          <View
            style={{
              backgroundColor:
                fat.pago === '1'
                  ? colors.$greenFinance
                  : isExpired(fat.vencimento)
                  ? colors.$redFinance
                  : colors.$yellowFinance,
              padding: 4,
              borderRadius: 4
            }}
          >
            <Text
              style={{
                fontSize: 12,
                color: colors.$background,
                fontWeight: '500'
              }}
            >
              {fnStatus(fat)}
            </Text>
          </View>

          <TouchableOpacity
            onPress={() =>
              navigation.navigate('FinancesItems', {
                id: fat.id
              })
            }
            style={{ justifyContent: 'space-between', alignItems: 'center' }}
          >
            <MaterialIcons
              name="more-horiz"
              size={40}
              color={colors.$primaryDark}
            />
            <Text style={{ marginTop: 4, fontSize: 12, fontWeight: '400' }}>
              Ver mais
            </Text>
          </TouchableOpacity>
        </View>
      ))
    } else {
      return (
        <View style={{ marginBottom: 6, marginTop: 6 }}>
          <Text>Não existem faturas para esse mês</Text>
        </View>
      )
    }
  }

My types:

image

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant